Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated

LabWindows/CVI Error: "Undefined symbol..." When Using a DLL



Primary Software: LabWindows/CVI Development Systems>>LabWindows/CVI Full Development System
Primary Software Version: 15.1
Primary Software Fixed Version: N/A
Secondary Software: LabWindows/CVI Run-Time Engine

Problem:
I am using a DLL in LabWindows/CVI, and when I build the project I get the following error:

Undefined symbol '___ImageBase' referenced in "c:\program files (x86)\national instruments\cvi2015\bin\msvc\cvistart.lib.

Solution:
The error above is a linker error indicating that the compiler can't find a definition for ImageBase. Since this only occurs when making a call into the DLL in the program, this suggests that the issue lies with the linker files (.lib files) for the DLLs being used. It is likely that the linker file was generated specifically for a different compiler and its definition of ImageBase (which is a special symbol created by the linker) and conflicts with LabWindows/CVI's definition in cvistart.lib.

The best way to attempt to fix linker issues is to regenerate the import libraries. If you open the header for the DLL in LabWindows/CVI, you will find Options >> Generate DLL Import Library... which will allow you to target the DLL and generate a new .lib file. Once this has been completed, remove the old linker file, and replaced it with the newly generated one.

Related Links:
KnowledgeBase 25N8FHLS: What Are the Differences Between the .lib Files in the cvi\bin Directory and Those in the cvi\extlib Directory?
KnowledgeBase 3TTHO2ZW: Linker Errors When Using LabWindows/CVI Static Libraries and Object Files in Microsoft Visual Studio 2005

Attachments:





Report Date: 09/18/2017
Last Updated: 10/06/2017
Document ID: 7PHFD8NA

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit