visual-studio-2010static-librariesc89cvi

Static Library created in VS2010 not linkeable in CVI


I created a simple static Ansi-C90 library with VS2010. I was able to create a C++ project in VS2010, import and fully test the lib.

I opened a LabWindows CVI project and tried to import the lib file there.

Unfortunatelly there is not much to go on - the only message i get is: "Bad header encountered while reading external module: 'Release\mylib.obj'"

Is there some way how i can investigate whats wrong with my lib file? Is there some standard format that VS2010 is not following?


EDIT #1:

I identified a possible source of the problem but i am currently unable to check that. VS2010 does not compiling as static-single-thread-libraries - that feature was removed. It is possible that CVI can not handle static-multi-thread-libraries.

I also posted this question on the NI Forum.

EDIT #2:

NI Forum link was broken - i assume its NIs fault and provide a Google Search Link for the posting.


Solution

  • User Mohan in the NI Forums posted the answer there.

    One option in visual studio needs to be changed so CVI can import the file:

    Properties -> General -> Whole Program Optimization

    Default is: "Use Link Time Code Generation"

    Has to be changed to: "No Whole Program Optimization"