c++ fatal error C1189: #error:解决方案

c++C1189错误解决方案:

fatal error C1189:

方案1

方案2:修改源码:

 LNK1104: cannot open file 'MSCOREE.lib'


fatal error C1189:

错误类型:(atl)

1、C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\mutex(8): fatal error C1189: #error:  <mutex> is not supported when compiling with /clr or /clr:pure.

2、C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\thread(8):fatal error C1189: #error:  <thread> is not supported when compiling with /clr or /clr:pure.

方案1

参考博客:https://blog.csdn.net/v_zhangyang/article/details/69784024

方案2:修改源码:

修改C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\mutex 文件:

#ifndef RC_INVOKED

#ifdef _M_CEE
#ifndef _CLR_NATIVE_THREADS  //添加运行时原生线程
#error <mutex> is not supported when compiling with /clr or /clr:pure.
#endif /* _CLR_NATIVE_THREADS */
#endif /* _M_CEE */

添加#ifndef _CLR_NATIVE_THREADS    #endif

同理修改thread文件

 LNK1104: cannot open file 'MSCOREE.lib'

解决方案:

如果出现这个链接错误,请添加library directories: C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib (请根据自身电脑Microsoft SDKs文件位置添加)

或者修改如下(链接器处添加(主流方式))

 

写在最后:

文章来源项目实践,文章存在任何问题,请指正错误,谢谢您的阅读! 

转载请您注明来源,谢谢你!

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值