LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Project link error with library build with Visual C++ comiler with option /MD

my LabWindows/CVI project includes a  library that was according to the supplier build using Visual C++ compiler with option /MD, so that both multithread- and DLL-specific versions of the run-time routines are selected from the standard .h files. This option also causes the Visual C++ compiler to place the library name MSVCRT.lib into the .obj file. (see http://msdn2.microsoft.com/en-us/library/2kzt1wy3(VS.71).aspx for further details). The build of my application aborts with the following linker errors:

 5 Project link errors
  Undefined symbol '__imp__exit' referenced in "thirdparty.lib".
  Undefined symbol '__imp____p__environ' referenced in "thirdparty.lib".
  Undefined symbol '_putenv' referenced in "thirdparty.lib".
  Undefined symbol '_access' referenced in "thirdparty.lib".
  Undefined symbol '__imp___iob' referenced in "thirdparty.lib", "thirdparty.lib", and "thirdparty.lib".

In the suppliers documentation for the library it is said that the linker option /NODEFAULTLIB:"LIBCD.LIB" must be set when the application is build with the Visual C++ compiler. I don't know whether this would solve the problem in LabWindows, anyway it is not possible to set any linker options in LabWindows(?) I found a mas of similar linker problems like the above in the web (search for __imp__exit), where it points out that it depends on linker settings, which LabWindows seem not to support.
I've tried with other options (compatibility to Borland C++ and corresponding library version, changing calling conventions etc.) without success.
Is there anybody out there who experienced similar problems or may have a solution for me?

Thanks in advance, Walter
0 Kudos
Message 1 of 3
(3,663 Views)
Hello Walter,

you could try to generate a DLL import library in cvi itself. Open your .h-file  in CVI go to options
and then hit  "Generate DLL Import Library". Using this lib possibly fixes the problem.

regards

Marco Brauner NIG
0 Kudos
Message 2 of 3
(3,601 Views)
Hello, thank you very much for your reply! I tried this option and actually it helps "some", that means instead 5 linking errors I got only one undefined symbol of a function my code is calling from the library. I guess there is a dll which I do not know which includes the missing function.

Anyway, I tried with LabWindows/CVI version 8.1 and surprisingly the linker errors disappeared!
Hello NI, what has changed in your library? I'm using LabWindows/CVI 7.1.1 where the linker error has occured.

regards, W. Lenz
0 Kudos
Message 3 of 3
(3,568 Views)