Test and Measurement Forum

Linking with rh0232.lib

Post general discussions on using our drivers to write your own software here

Linking with rh0232.lib

Postby Guest » Tue Sep 09, 2003 7:04 pm

Hi,

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:-


C:\PICO\scoot>bcc32 scoot.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
scoot.c:
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.
OBJ
Error: Unresolved external 'rh02_get_value' referenced from C:\PICO\SCOOT\SCOOT.
OBJ
Error: Unresolved external 'rh02_close_unit' referenced from C:\PICO\SCOOT\SCOOT
.OBJ

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 :-

ilink32 scoot.obj

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 :)

Cheers,

Scoot.
Guest
 

Postby Guest » Tue Sep 09, 2003 7:09 pm

erm.. despite me logging in - these messages appear as guest - if I put my username in the box - it tells me that user is already registered. I know this - it was me - 2 minutes previous :)
Guest
 

Postby markspencer » Wed Sep 10, 2003 7:44 am

Hi,

Although I am unable to help you fully, I would suggest that you create a project using the files form our examples, which can be downloaded from [url=http:\\www.picotech.com\software.html]here[/url].

When you create the project ensure that you have Win32 selected as the platform, this is part of the #define in the header file. The Lib file and .dll should both be in the same directory as the .ide file. The .lib file should be included in the project. They should be included into the .exe part of the project, if all this is correct they project should compile and link correctly.

Best regards,
Regards,

Mark Spencer
User avatar
markspencer
Site Admin
Site Admin
 
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Postby Guest » Wed Sep 10, 2003 10:35 am

Hi Mark. Thanks very much for your reply. I don't have the full GUI IDE from Borland, but I'll see if we have any spare licenses.

I'm from a Unix background myself so I'm not too familiar with Windows libraries (and I've not written any code for years !)- I'm just looking into this whole C++/C dll problem now, as it look slike mismatches in the language between dlls and exe's can cause similar symptoms. Is the rh0232.dll a C++ library? If it is, then this is probably my problem - I have tried adding defining __cplusplus before including the rh0232.h which casues to make use of the extern "C" declaration modifier but this causes errors of it's own :-/

Sounds like the simplest thing though is to follow the proven method you describe - I'll see if I can aquire the ingredients.

Thanks again.
Guest
 

Postby markspencer » Thu Sep 11, 2003 7:44 am

Hi,

The .dll is written in C. If you include the RH02.h file in your program this has all the required #defines included. If you are unable to specify that the platform you are using is win32 from Borland, this can also be #defined in the rh02.h header file. It would have to be the first line.

I hope this will be af help.

Best regards,
Regards,

Mark Spencer
User avatar
markspencer
Site Admin
Site Admin
 
Posts: 598
Joined: Wed May 07, 2003 9:45 am

error in picture encryption coding for C++

Postby brunei_boy84@yahoo.com » Tue Apr 26, 2005 3:46 am

I'm a beginner in C++ programming. I have a problem while trying to make a coding to encrypt a picture to a binary. Could u help me to solve this problem or can u give me a simple C++ programming coding to load a picture from file, then encrypt the picture to binary value and then save it...i really want the coding because i wanna learn more about C++ programming.
brunei_boy84@yahoo.com
 

Postby Sarah » Tue Apr 26, 2005 8:07 am

Hi

Thank you for your post.

Unfortunately we are only able to provide support for programming with our units. Maybe someone else on here can help you.

Best Regards
Sarah
 


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 1 guest