日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

CUDA在Debug下编译有错而Release下无错

發布時間:2023/11/30 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 CUDA在Debug下编译有错而Release下无错 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

錯誤提示:

1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR90D.dll)

在經過搜索后采用了忽略 msvcrtd.lib,額外的庫添加:LIBCMT.lib

這樣可以編譯通過,但是Debug版本運行后很多錯誤提示。

后加入群,兩個人的意見有建設性!

1. 改成MTD,但現在編譯會提示

1>c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxver_.h(81) : fatal error C1189: #error :? Please use the /MD switch for _AFXDLL builds
然后他說: 也就是改用靜態庫,同時MTD。編譯運行通過

_AFXDLL tells the compiler to use the DLL version of the MFC libraries. But when you do this you must also use the DLL version of the CRT libraries (/MD compiler option).
?
When you switched to static linking, you should have changed to "Use MFC in a static library" (as Hans told you). This would have automatically changed your CRT setting to /MT. But it seems that you just changed to /MT without changing the MFC setting, so your project was inconsistent. When you got rid of _AFXDLL, the compiler thought you did not want MFC at all, so it did not recognize the MFC calls.
2.

把這兩個目錄:

SPH-CUDA(736183739) 17:40:36
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\C\common
SPH-CUDA(736183739) 17:40:50
C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK 3.2\shared
下的重新用MDd編譯。默認的是用MT編譯的,而我們自己自動生成的MFC里默認是MD編譯的,也就是不一致!

但這個我后來再改第一個方法成功后沒有嘗試這個。

轉載于:https://www.cnblogs.com/kyleada/archive/2011/08/11/2135352.html

總結

以上是生活随笔為你收集整理的CUDA在Debug下编译有错而Release下无错的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。