visual studio configuration type dll: how to turn off lib overwrite?

1k Views Asked by At

Is it possible to turn off the .lib overwrite when building a dll in VS2010?

I need both the .lib and the .dll, but when i turn the configuration type back to dll, my .lib in the outpufolder gets overwritten by a 1-2KB .lib which is useless for linking in my main project.

1

There are 1 best solutions below

2
On BEST ANSWER

Edited after comment

If you want a dynamic library (creates dll and lib file) and a static library (lib file), you need separate configurations in Visual Studio for building a dynamic library and a static library.

Usually VS provides per default a "Debug" and a "Release" configuration. You could add additionally a "DebugStatic" and a "ReleaseStatic" configuration for your static library.

Per default VS uses the configuration names as output directories, so you would have the following dirs:

-project
--Debug
---libraryd.dll
---libraryd.lib
--Release
---library.dll
---library.lib
--DebugStatic
---libraryd.lib
--ReleaseStatic
---library.lib