Reputation: 5058
I had a C/C++ Visual Studio 2013 Community Edition project that was defined to generate a DLL, and I'm having a lot of misery with "undefined symbols" which I wanted to use in another project, so I decided to see what it would give if I changed the project settings so that it would generate a static library instead.
So in the Properties window of the project I went to
Configuration Properties > General > Project Defaults > Configuration Type
and set the Configuration Type to Static Library The target extension is .lib.
When I do a rebuild I still get a fresh dll file in my Release folder, as well as a lib, and the DLL file is much bigger than the lib file. This makes the lib file look like an "export lib" file and it looks like nothing has changed. This still happens if I stop and restart Visual Studio.
Am I missing something or does this look like a bug to you?
Upvotes: 0
Views: 2110
Reputation: 8401
In Configuration Properties - C/C++ - Runtime Library
change setting to Multi-threaded (/MT)
for Release
configuration and to Multi-threaded Debug (/MTd)
for Debug
configuration.
Also, check Configuration Properties - General - General - Target extension
is set to .lib
.
Check settings for all configurations (Release
and Debug
if you use them).
Upvotes: 1
Reputation: 12088
Why have you changed your project type? If you need DLL, build DLL. Post exact errors received during DLL compilation. Perhaps you missed some dllexport
/dllimport
declspecs.
Regarding .lib
: are you sure, that DLL is generated during build? Perhaps it is the output from previous (DLL) configuration? Have you tried to compile test app using this .lib
? Perhaps it is valid and compiled properly?
Another matter: have you removed all dclspecs from function signatures after project type change? When building static library, none of them are applicable.
Upvotes: 0