vs2022重新編譯opencv-python?cuda加速時報錯的問題解決
今天重新編譯了一下Windows的opencv-python的cuda加速
在生成INSTALL的時候報錯
嚴重性 代碼 說明 項目 文件 行 禁止顯示狀態(tài)
錯誤 C2059 語法錯誤:“)” opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 324
警告 C4819 該文件包含不能在當前代碼頁(936)中表示的字符。請將該文件保存為 Unicode 格式以防止數(shù)據(jù)丟失 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 1
錯誤 C2059 語法錯誤:“for” opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 324
錯誤 C2143 語法錯誤: 缺少“)”(在“;”的前面) opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 324
錯誤 C2065 “i”: 未聲明的標識符 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 324
錯誤 C2065 “i”: 未聲明的標識符 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 324
錯誤 C2275 “std::string”: 將此類型用作表達式非法 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 326
錯誤 C2146 語法錯誤: 缺少“)”(在標識符“input_info”的前面) opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 326
錯誤 C2065 “input_info”: 未聲明的標識符 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 328
錯誤 C2065 “input_info”: 未聲明的標識符 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 350
錯誤 C2737 “gtest_ar”: 必須初始化 const 對象 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 350
錯誤 C2059 語法錯誤:“}” opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 435
錯誤 C2143 語法錯誤: 缺少“;”(在“}”的前面) opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 435
仔細看卻是報了個寂寞,當然最重要的是
嚴重性 代碼 說明 項目 文件 行 禁止顯示狀態(tài)
警告 C4819 該文件包含不能在當前代碼頁(936)中表示的字符。請將該文件保存為 Unicode 格式以防止數(shù)據(jù)丟失 opencv_test_objdetect D:\opencv\opencv\source\opencv-4.x\modules\objdetect\test\test_qrcode_encode.cpp 1
由此可見,是文件編碼的問題,而且這個文件里面還有日文
所以更改文件編碼格式保存
VS2022的更改文件編碼的功能是隱藏的
首先在工具一欄找到自定義
在自定義里選擇命令
將菜單欄改為文件
點擊添加命令
在類別找到文件,在右邊命令一欄找到“高級保存選項”
點確定,返回后選中“高級保存選項”,使用上移或下移,移動到合適的位置后,關(guān)閉
在文件中就能看到高級保存選項了
打開后,將文字編碼改為936的簡體中文
完成后保存重新編譯生成問題就解決啦。
到此這篇關(guān)于vs2022重新編譯opencv-python cuda加速時報錯的問題解決的文章就介紹到這了,更多相關(guān)vs2022重新編譯opencv-python cuda 內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Protocol Buffer技術(shù)深入理解(C++實例)
C++實例Protocol Buffer技術(shù)詳解,感興趣的朋友可以了解下2013-01-01關(guān)于C/C++中static關(guān)鍵字的作用總結(jié)
以下是對C/C++中static關(guān)鍵字的作用進行了總結(jié)介紹,需要的朋友可以過來參考下2013-09-09Qt音視頻開發(fā)之利用ffmpeg實現(xiàn)倍速播放
這篇文章主要為大家詳細介紹了在Qt音視頻開發(fā)中如何利用ffmpeg實現(xiàn)倍速播放功能(半倍速/2倍速/4倍速/8倍速),感興趣的小伙伴可以了解一下2022-11-11C++11中內(nèi)聯(lián)函數(shù)(inline)用法實例
內(nèi)聯(lián)函數(shù)本質(zhì)還是一個函數(shù),但在聲明的時候,函數(shù)體要和聲明結(jié)合在一起,否則編譯器將它作為普通函數(shù)來對待,下面這篇文章主要給大家介紹了關(guān)于C++11中內(nèi)聯(lián)函數(shù)(inline)的相關(guān)資料,需要的朋友可以參考下2022-10-10