c++C1189錯誤解決方案:
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文件位置添加)
或者修改如下(鏈接器處添加(主流方式))
寫在最後:
文章來源項目實踐,文章存在任何問題,請指正錯誤,謝謝您的閱讀!
轉載請您註明來源,謝謝你!