简体   繁体   English

Visual Studio配置类型dll:如何关闭lib覆盖?

[英]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? 在VS2010中构建dll时,是否可以关闭.lib覆盖?

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. 我同时需要.lib和.dll,但是当我将配置类型转回dll时,输出文件夹中的.lib被1-2KB .lib覆盖,这对于在我的主项目中链接毫无用处。

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. 如果要使用动态库(创建dll和lib文件)和静态库(lib文件),则需要在Visual Studio中使用单独的配置来构建动态库和静态库。

Usually VS provides per default a "Debug" and a "Release" configuration. 通常,VS默认情况下会提供“调试”和“发布”配置。 You could add additionally a "DebugStatic" and a "ReleaseStatic" configuration for your static library. 您可以为静态库另外添加“ DebugStatic”和“ ReleaseStatic”配置。

Per default VS uses the configuration names as output directories, so you would have the following dirs: 默认情况下,VS使用配置名称作为输出目录,因此您将具有以下目录:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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