Reputation: 11681
I currently have a C++ project that is built using msbuild. Once the project is built I get an exe along with multiple dll files. Is there a way to tell msbuild to link to those libraries statically ? I cannot open the project in visual studio but I can make changes to the vcxproj. Any suggestions on how I can accomplish that ?
Upvotes: 0
Views: 941
Reputation: 582
I tried to add a lib file into a clean project, and the modification of vcxproj file are below, hope it can help you:
Upvotes: 0
Reputation: 10103
In the vcxproj files, change:
<ConfigurationType>DynamicLibrary</ConfigurationType>
To
<ConfigurationType>StaticLibrary</ConfigurationType>
Also, in the PreprocessorDefinitions
section(s), remove xxx_EXPORTS
(where xxx is the name of the project) and _USRDLL
, and replace with _LIB
Note: each of these (including ConfigurationType
) will appear once for each Configuration you have (i.e. Debug, Release, etc.).
Upvotes: 1