LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Labwindows/CVI 5.0 gives an undefined symbol error when using a 3rd party static library.

Program compiles and recognizes 3rd party commands in .h file (right clicking on function call and selecting show definition goes to correct command), but gives a link error and says the function is an undefined symbol when compiling. Dll and Lib files are in the same directory as project.
0 Kudos
Message 1 of 5
(3,975 Views)
You need to add the .LIB file to your project. Just having the file in the same directory as the DLL file doesn't tell the linker to use it. In the project window, goto Edit >> Add Files to Project..., and select the .LIB file.
0 Kudos
Message 2 of 5
(3,973 Views)
The .lib file is part of my project already. I have been able to get the same API working in Visual C++ 6.0, but have had no luck in CVI. This same API works in LabView as well according to the 3rd party developer. In order to compile the project initially I had to include the windows.h file which allowed for the WINAPI command and never had to do this in the past. Do I need to change my project settings?
0 Kudos
Message 3 of 5
(3,973 Views)
Hi,

Are you sure that the functions that get a linker error are defined in the DLL you are calling. I had an issue just like that, the h file actually contained functions implemented in 2 separate DLLs, so I had to include a second .lib file to get it to link.

There are a couple of things that you can try, you can have CVI create a lib file for the dll based on the h file. Just open the h file go to Options >> Generate Import Library this should generate a lib file correct for that dll and it will tell you if there are any functions in the h file that are not found in the dll.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 4 of 5
(3,973 Views)
I found the problem. The compatability mode was set to Borland 5.0 and when I switched it to Microsoft Visual C++ 6.0, it all works as advertised. Thanks,
Mike Ryan
0 Kudos
Message 5 of 5
(3,973 Views)