Undefined Symbol Error When Compiling LabWindows™/CVI™ Project

Updated Nov 18, 2021

Reported In

Software

  • LabWindows/CVI Full

Issue Details

I am trying to compile a LabWindows/CVI project, but I am getting errors that are referenced as Link Error or Undefined Symbol errors.

Solution

This type of error can occur for multiple reasons, most of them involve a reference to a function or variable that the linker could not resolve or find a definition for. This can happen when the compiler cannot identify if the symbol is defined since it could be in a different source file or library. In order to fix this type of issue please try the following troubleshooting steps:
  • The most common source of this error is that the object file or library containing the definition of the symbol is not correctly linked. Please make sure that the library that contains the symbol definition and referenced in the error message is linked as part of the LabWindows/CVI project.
  • Ensure that the header file (ending in .h) and the import library (.lib) are both included in the LabWindows/CVI project. Also, make sure all the names of functions or variables in the header files (.h) and source code (.c) match. 
  • Place the DLL being referenced in the same directory as your LabWindows/CVI application so that you can determine if LabWindows/CVI is having issues locating the correct DLL.
  • This error can also happen when porting a LabWindows/CVI application from 32-bit to 64-bit. Please take into consideration that you can load 32- and 64-bit DLLs only into processes with the same bitness. Please make sure that you reconfigure your project to use external DLLs using their 64-bit DLLs. For example, if porting an application that uses the NI-IMAQ driver you need to add this library by selecting Edit >> Add Files to Project >> Library and locating the 64-bit lib file located at C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib64\msvc. Your project should look like the image below. Please note that the NI-IMAQ is not fully supported in 64-bit: NI Vision Development Module and Vision Acquisition Software 64-bit Programming Language Support.
Screenshot_1.png