简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM