Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to `Ibsta

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

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/linker-error-when-using-dev-C-for-GPIB/td-p/7...

again with ibdev command.

Download All
0 Kudos
Message 1 of 5
(4,469 Views)

My gpib.h states :

 

extern int insta,iberr, incnt;

 

But you are using them as functions.

0 Kudos
Message 2 of 5
(4,449 Views)

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.

Best regards,
Jano
0 Kudos
Message 3 of 5
(4,440 Views)

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.

0 Kudos
Message 4 of 5
(4,424 Views)

Hi Adam,

 

this really sounds like a good topic for a KB 🙂 Let's see what can be done about that 😉

 

Best regards,
Jano
0 Kudos
Message 5 of 5
(4,422 Views)