I’m using CMake to create a shared library via Visual Studio 2010. The solution outputs a dll file, but not a matching lib file. How do I tell CMake to generate the lib file so I can link other projects to the dll?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First of all check that you have at least one exported symbol in your shared library. Visual Studio does not generate the
.libfile if dll does not exports symbols.Next, check your cmake files – probably you have set
CMAKE_ARCHIVE_OUTPUT_DIRECTORYvariable orARCHIVE_OUTPUT_DIRECTORYproperty of the shared library target. If these variable/property is set then Visual Studio will output.libfiles into the different directory specified by that variable/property. (There also can be configuration-specific versions likeARCHIVE_OUTPUT_DIRECTORY_Release.)