cmake编译ITK报错:The C compiler is not able to compile a simple test program

cmake编译ITK时出现如下错误:

The C compiler identification is MSVC 19.0.23026.0

Check for working C compiler: E:/Microsoft Visual Studio 14.0/VC/bin/cl.exe

Check for working C compiler: E:/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- broken

CMake Error at E:/CMake/share/cmake-3.8/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "E:/Microsoft Visual Studio 14.0/VC/bin/cl.exe" is not able
to compile a simple test program.

检查出错信息,发现:

LINK : fatal error LNK1104: 无法打开文件“MSVCRTD.lib”

打开VS2015,任选了一个工程,打开“属性管理器”->Debug|Win32->Microsoft.Cpp.Win32.user,"链接器"->"输入"->"附加依赖项"中有msvcrtd.lib,而"链接器"->"常规"->"附加库目录"中没有msvcrtd.lib的路径。遂添加msvcrtd.lib路径“$(VC_LibraryPath_x86)”,保存并退出VS2015,再用cmake编译ITK,就不再报错了。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值