I wrote a very simple program to output the 2 values from an rh02 to stdout (MRTG will be able to pick them up from there and graph them). After struggling with lcc and then MS Visual C++ to compile the damm thing, (with VC++ complaining endlessly about the words "pascal" and "far" in the header) I found this forum - and came to the conclusion that Borland BCC55 was the tool I needed.
OK - so after guessing my way through getting BCC set up (the .cfg files go in the "bin" directory if anyone is wondering, and set the path to the bin directory too - not it;s parent as the readme states). Also - the syntax for the ilink32.cfg is incorrect in the readme - it's /L, not -L.
I have my code: scoot.c, rh0232.dll rh02.h (without the word "far" in it - BCC55 doesn't like this either) and rh0232.lib in a directory. The program compiles fine, but it just refuses to link with rh0232.lib:-
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
Warning W8017 scoot.c 3: Redefinition of 'WIN32' is not identical
Warning W8070 scoot.c 24: Function should return a value in function main
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'rh02_open_unit' referenced from C:\PICO\SCOOT\SCOOT.
Error: Unresolved external 'rh02_get_value' referenced from C:\PICO\SCOOT\SCOOT.
Error: Unresolved external 'rh02_close_unit' referenced from C:\PICO\SCOOT\SCOOT
If I manually link it by doing:-
ilink32 scoot.obj rh0232.lib
It does generate an .exe - but it still hasn't actually linked in the .lib, and sometimes generates a rh0232.exe! Both files are of course, not valid win32 .exe's. In fact if I just do :-
it generates the exact same output in scoot.exe.
I even tried generating my own lib file using IMPLIB.EXE but it makes no difference. Checking the command line options for bcc32 and ilink32 there is no way to explictly say "link with this lib file" you can specify directories for the library search path with -L.
I'm sure it's something really dumb that I've done - but if anyone can shed any light on this it'd make me very happy