LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows 2012, linking Windows C Run Time library fails

I need to build a LabWindows application with linking prebuilt libraries (.lib) that were built with VS2010.  One of the .lib libraries is using function in fcntl.h that is not included in the LabWindows C run time environment. Is there a way to force LabWindows to use VS2010 Windows C Run Time environment?  I tried to import msvcrtd.lib from VS2010 but I get the following error:

 

3 Project link errors
 Bad header encountered while reading external module: 'f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\build\INTEL\dll_obj\tcmap\_mbccpy.obj'.
 Aborted load of member "f:\dd\vctools\crt_bld\SELF_X86\crt\prebuild\build\INTEL\dll_obj\tcmap\_mbccpy.obj" from library "c:\Users\ahallajp\Documents\LabWindowsProjects\VS2010\msvcrtd.lib".
 Aborted load of library "c:\Users\ahallajp\Documents\LabWindowsProjects\VS2010\msvcrtd.lib".

0 Kudos
Message 1 of 5
(2,712 Views)

Hi ah80,

 

Instead of forcing LabWindows/CVI to use the Visual Studio 2010 C Runtime Environment, have you tried including the fcntl.h in your LabWindows/CVI application?

0 Kudos
Message 2 of 5
(2,677 Views)

I'm getting a link error (undefined symbol) which indicates the definition of functions are missing. Including the fcntl.h header file will not solve the issue. I need to link a library that contains the definition of the functions in fcntl.h

I did try to use the DLL import generation capability in labwindows in order to create a .lib library from the Windows C Runtime DLL hoping that might link successfully but that didn't work either. There are syntax in windows header files that labwindows compiler does not recognize.

0 Kudos
Message 3 of 5
(2,673 Views)

Hi ah80,

 

Do you have the source code for these libraries built with VS2010? Would it be possible to recreate them in LabWindows/CVI?

 

Also, would you be able to provide some information on the background of these libraries? Were they created in ANSI C?

0 Kudos
Message 4 of 5
(2,648 Views)

No, I don't have the source code to the VS2010 libraries. They are third party libraries provided by a vendor and they don't distribute the source code.

 

Update on the issue:

I tried experimenting with newer versions of LabWindows and I was finally able to link the VS2010 C run time library using LabWindows 2017. 

0 Kudos
Message 5 of 5
(2,619 Views)