Visual Studio 2010 违背我的意愿创建静态库
我最近继承了一个我已经清理并完成的项目。然而,有一个恼人的问题一直困扰着我。每当我构建它时,它都会在 *.exe 旁边创建一个静态库(*.lib + *.exp 文件)。 *.lib 文件是不必要的。我一生都找不到在设置中关闭此功能的位置。构建它并没有什么坏处,只是很烦人。
I recently inherited a project which I've cleaned up and finished. However, there is one annoying issue that is just bugging the heck out of me. Whenever I build it, it creates a static library (*.lib + *.exp files) alongside the *.exe. The *.lib file is unnecessary. I can't for the life of me find where in the settings to turn this off. It doesn't hurt anything to build it, it's just annoying.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也有同样的问题,而且我是一个非常迂腐的人,所以我介意。所以我
在不需要的 .lib 文件上使用了它,它显示:
经过一段时间的谷歌搜索,我发现了 post,解释这是一个自动生成的函数,仅在以下情况下生成使用动态链接的运行时库(静态不会这样做)。
要解决此问题,请转到项目属性 > C++ > > 预处理器,并添加:
或转到项目属性 > C++ > > 代码生成并将运行时库更改为多线程(MT)。
烦人的文件现在消失了,是的:)。不过,已在 Visual Studio 2008 中进行了测试。但如果它不起作用,只需在 .lib 上使用 dumpbin /EXPORTS 来跟踪导出并将其发布到此处。
I had the same problem, and since I'm a very pedantic person, I mind. So I used
On the unwanted .lib file, and it reveals:
And after a while of googling, I found a post, explaining this is an automatically generated function, which is only generated when using dynamically-linked runtime library (static doesn't do that).
To fix the problem, either go to Project Properties > C ++ > Preprocessor, and add:
Or go to Project Properties > C ++ > Code Generation and change Runtime Library to Multithreaded (MT).
The annoying files are now gone, yay :). Tested in Visual Studio 2008, though. But if it doesn't work, just use dumpbin /EXPORTS on the .lib to trace exports and post them here.
项目被指定为静态库,或者解决方案中有一个项目是静态库。
Either the project is designated as a static library or there is a project in the solution that is a static library.