From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

"Symbol Undefined" error when trying to compile GPIB examples

I'm trying to compile the examples written in C that are given in the folder \VXIPNP\WinNT\NIvisa\Examples\C\Gpib. Using a standard ANSI C compiler, I get the following error messages:

AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viClose@4
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viTerminate@12
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viReadAsync@16
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viWrite@16
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viEnableEvent@16
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viInstallHandler@16
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viOpen@20
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viOpenDefaultRM@
4
AsyncIO.obj(AsyncIO)
Error 42: Symbol Undefined _viGetAttribute@12

--- errorlevel 9

Any help is appreciated.
0 Kudos
Message 1 of 2
(2,840 Views)
Hi esi_stents,

The compiler is complaining here because it can't find the correct library file to link to. Therefore, each of the above errors are function calls that the compiler does not have a prototype for.

The library file you want to make sure to link to is visa32.lib. The path for this library file differs slightly based on what compiler you are using:
  • Borland: C:\VXIPNP\WinNT\lib\bc

  • Microsoft: C:\VXIPNP\WinNT\lib\msc


  • Then follow the instructions for your compiler on how to set up links to a library.

    Now the compiler should stop complaining at you and you're good to go! Have fun!

    Kileen Cheng
    Applications Engineer
    National Instruments
    0 Kudos
    Message 2 of 2
    (2,840 Views)