如何在编译中使用/NODEFAULTLIBS 选项? [英] How to use /NODEFAULTLIBS option in compilation?
问题描述
我有一个包含 2 个项目的解决方案资源管理器.对于一个项目,我使用 /mdd
启用了 /clr
.对于父项目,我有 /mtd
并且没有 clr 支持.当我编译这个时,我得到两个链接器错误,包括以下一个:
I have a solution explorer contains 2 projects. For one project I have enabled /clr
with /mdd
. For parent project I have /mtd
and no clr support. When I compile this I get two linker errors including the below one:
链接警告链接 4098:默认库可能与其他库使用/NODEFAULTLIBS 库发生冲突
所以我的问题是如何在编译中使用 /NODEFAULTLIBS
.
So my question is how to use /NODEFAULTLIBS
in compilation.
提前致谢.
推荐答案
首先,如果可以,您需要找出导致冲突的库.链接警告是否告诉您什么?
First you need to work out which library is causing the conflict, if you can. Does the link warning tell you anything?
然后你需要打开这个项目的属性页,进入链接器->命令行.在其他选项"区域中,输入:
Then you need to open the property pages for this project, and go to Linker -> Command Line. In the 'Additional Options' area, type:
/NODEFAULTLIB:xxx.lib
/NODEFAULTLIB:xxx.lib
其中 xxx.lib 是冲突的库.但是,如果您无法确定它是哪个库,请尝试:
where xxx.lib is the conflicting library. However, if you couldn't work out which library it is, try just:
/NODEFAULTLIB
/NODEFAULTLIB
这篇关于如何在编译中使用/NODEFAULTLIBS 选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!