[問題] opencv2.4.11 use Visual Studio2013 err

看板C_and_CPP作者 (Portran)時間8年前 (2015/09/22 16:23), 8年前編輯推噓0(007)
留言7則, 5人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) VC++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) OpenCV 問題(Question): visual studio 2013 使用opencv函式庫時,無法跳出cmd視窗 餵入的資料(Input): lena.png 預期的正確結果(Expected Output): 顯示圖片 錯誤結果(Wrong Output): C:\Windows\SysWOW64\sysfer.dll 找不到或無法開啟PDB檔案。 跳出訊息視窗,顯示應用程式無法正常啟動(0xc000007b), 請按一下[確定]關閉應用程式。 程式碼(Code):(請善用置底文網頁, 記得排版) #include "opencv2/highgui/highgui.hpp" #include <iostream> using namespace cv; using namespace std; int main(int argc, const char** argv) { Mat img = imread("lena.png", CV_LOAD_IMAGE_UNCHANGED); //read the image data in the file "MyPic.JPG" and store it in 'img' if (img.empty()) //check whether the image is loaded or not { cout << "Error : Image cannot be loaded..!!" << endl; //system("pause"); //wait for a key press return -1; } namedWindow("MyWindow", CV_WINDOW_AUTOSIZE); //create a window with the name "MyWindow" imshow("MyWindow", img); //display the image which is stored in the 'img' in the "MyWindow" window waitKey(0); //wait infinite time for a keypress destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow" return 0; } 補充說明(Supplement): 電腦作業系統win7 有使用Symantec EndPoint Protection,會是防毒擋掉? 若不開圖檔或不跳訊息視窗都是正常執行,無錯誤清單。 附圖 http://imgur.com/3iSG6Db
就請各位大大幫忙求解了。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.115.156.182 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1442910191.A.1A5.html ※ 編輯: zxgpkm (140.115.156.182), 09/22/2015 16:26:59

09/22 16:56, , 1F
原來用系統管理員執行就OK了,但出現fopen.c讀取存取違規
09/22 16:56, 1F

09/22 16:57, , 2F

09/22 21:46, , 3F
程式我看沒問題,試了也是ok,你會不會是有設定錯誤
09/22 21:46, 3F

09/23 02:58, , 4F
你引用的lib是debug用的還是release用的?
09/23 02:58, 4F

09/23 08:07, , 5F
你的圖有放對位置? 要不要先試試絕對路徑?
09/23 08:07, 5F

09/23 08:17, , 6F
試試看是不是這個, http://goo.gl/2jR2wy
09/23 08:17, 6F

09/23 13:05, , 7F
最終成功,重開新專案將環境變數全改x86忽略x64謝各位幫忙
09/23 13:05, 7F
文章代碼(AID): #1M0G_l6b (C_and_CPP)