06-15-2012 09:53 AM
Hello,
I recently have a GPIB NI 488.2 card for windows. I work on Win XP 32 bit. I try to compile the 'c' source code (attached to the message) supplied with the card. I try to compile it with gcc compiler contained in Code::Blocks 10.05.I have added the msvc gpib-32.obj to the project (the borland one is not recognized by gcc).
However, I get an error
main.c:30: undefined reference to `Ibsta@0'
main.c:106: undefined reference to `Iberr@0'
main.c:129: undefined reference to `Ibcnt@0'
The full compiler log is attached as well.
It does not matter if I include the gpib-32.obj to the linker in Project -> built options -> Linker settings as was suggested in discussion in
The compiler eats the line 23 with ibdev, it means that the header and obj files are there, however it has troubles with the command Ibsta etc. Can you please help me? I can compile well the program showed in
again with ibdev command.
06-18-2012 12:09 AM
My gpib.h states :
extern int insta,iberr, incnt;
But you are using them as functions.
06-18-2012 04:11 AM
Hi Adam,
I'm wondering if this might have something to do with the difference between the GPIB-32 API and the NI-488.2 API. Basically in one, those (Ibsta, Iberr, lbcnt) are commands and in the other those are variables.
Please try to take a look at this forum thread and see if it helps you any further.
06-19-2012 01:25 AM
Hi Jano,
exactly, I was confusing the two API. When I compile with the old GPIB-32 API (which is a good idea since I work still on a 32 bit computer), everything works. Since obviously, I'm not the only one struggeling with the issue, it would be helpfull if these infos were summarized by NI guys in a readme files located in the directories of the header and obj files.
anyway, thanks a lot.
06-19-2012 01:32 AM - edited 06-19-2012 01:35 AM
Hi Adam,
this really sounds like a good topic for a KB 🙂 Let's see what can be done about that 😉