LNK4098 defaultlib 'library' conflicts with use of other libs; use /NODEFAULTLIB:library

本文介绍了解决LNK4098错误的方法,该错误通常出现在使用多个运行时库导致冲突的情况下。通过在链接器选项中使用/NODEFAULTLIB参数可以忽略不必要的运行时库。

LNK4098
defaultlib ‘library’ conflicts with use of other libs; use /NODEFAULTLIB:library
https://msdn.microsoft.com/en-us/library/6wtdswk0(v=vs.140).aspx

解决方案:You can tell the linker to ignore the incorrect run-time libraries by using /NODEFAULTLIB for each library you want to ignore.

link 选项里面加:
/NODEFAULTLIB:xxx.lib

[main] 正在生成文件夹: e:/Unity-master/Unity-master/examples/example_8/build ALL_BUILD [build] 正在启动生成 [proc] 正在执行命令: "C:\Program Files\CMake\bin\cmake.EXE" --build e:/Unity-master/Unity-master/examples/example_8/build --config Debug --target ALL_BUILD -j 12 -- [build] ���� .NET Framework �� Microsoft (R) ��������汾 15.9.30+gc0e4b0e683 [build] ��Ȩ����(C) Microsoft Corporation����������Ȩ���� [build] [build] cl : ������ warning D9025: ������д��/W3��(�á�/w��) [E:\Unity-master\Unity-master\examples\example_8\build\MCUSim.vcxproj] [build] TestControlCode.c [build] ControlModelCal.lib(IPA_MainControl.obj) : warning LNK4075: ���ԡ�/EDITANDCONTINUE��(���ڡ�/SAFESEH���淶) [E:\Unity-master\Unity-master\examples\example_8\build\MCUSim.vcxproj] [build] LINK : warning LNK4098: Ĭ�Ͽ⡰LIBCMTD�����������ʹ�ó�ͻ����ʹ�� /NODEFAULTLIB:library [E:\Unity-master\Unity-master\examples\example_8\build\MCUSim.vcxproj] [build] TestControlCode.obj : error LNK2001: �޷��������ⲿ���� _controlstatus [E:\Unity-master\Unity-master\examples\example_8\build\MCUSim.vcxproj] [build] E:\Unity-master\Unity-master\examples\example_8\build\bin\Debug\MCUSim.exe : fatal error LNK1120: 1 ���޷��������ⲿ���� [E:\Unity-master\Unity-master\examples\example_8\build\MCUSim.vcxproj] [proc] 命令“"C:\Program Files\CMake\bin\cmake.EXE" --build e:/Unity-master/Unity-master/examples/example_8/build --config Debug --target ALL_BUILD -j 12 --”已退出,代码为 1 [driver] 生成完毕: 00:00:01.274 [build] 生成已完成,退出代码为 1 [main] 无法准备名称为 "undefined" 的可执行目标
最新发布
10-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值