This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Undefined Symbol Error in LabWindows™/CVI with NI Instrument Drivers

Updated Jul 25, 2023

Reported In

Software

  • LabWindows/CVI Full
  • LabWindows/CVI Base

Issue Details

I am trying to compile a LabWindows™/CVI project that uses several NI instrument driver libraries such as NI-VXI, GPIB, NI-DAQmx, NI-DMM, NI-SWITCH, etc. When I build the project, I receive undefined symbol errors for each of the functions related to these drivers in my project. I did not receive these errors in a different system and I have not changed my project settings. What is causing this error and how can I resolve it?

Solution

This error occurs when the LabWindows/CVI linker cannot find the .lib file for the instrument libraries. These libraries can be automatically linked into projects from the Library >> Customize Library Menu dialog. Select the libraries to add to the LabWindows/CVI Library Menu and enable them to be linked to projects. If the specific NI driver is not listed in this list then you can manually add the .lib file by following these steps:
1. Click on Edit >> Add Files to Project >> Library.
2. Locate the .lib file for the driver that is causing the linker errors. Here are some common locations depending on the driver:
  • NI-DMM, NI-SWITCH: C:\Program Files (x86)\IVI Foundation\IVI\Lib\msc
  • NI-DAQmx: C:\Program Files (x86)\National Instruments\Shared\CVI\Bin\msvc
  • VXI, GPIB: C:\Program Files (x86)\National Instruments\CVI<version>\bin\msvc\nivxi.lib
Note: If you are using a 64-bit project look for the equivalent paths at Program Files.
3. Add the .lib file to your project for the missing instrument drivers and recompile the project.

In earlier versions of LabWindows/CVI, a stub version of these libraries was automatically linked to projects when the VXI or GPIB/GPIB 488.2 libraries were disabled. This stub version allows projects with VXI or GPIB references to be built when the vxi.lib and gpib.lib libraries are not on the system. 

You may find the stub files in the following locations:
  • GPIB — <National Instruments>\CVIversion\bin\msvc\gpibstub.obj
  • VXI — <National Instruments>\CVIversion\bin\msvc\vxistub.obj
Where version is the version number of LabWindows/CVI you are using. You can add the stub files to your project to build your project without the .lib files.

Additional Information

The "Undefined Symbol" error is generic and can appear in a lot of cases. Take a look at the articles in the Related Links section for more information on how to troubleshoot this type of error.