看板 C_and_CPP 關於我們 聯絡資訊
開發平台(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
zxgpkm: 原來用系統管理員執行就OK了,但出現fopen.c讀取存取違規 09/22 16:56
zxgpkm: http://imgur.com/df7H6xb 09/22 16:57
james1022jk: 程式我看沒問題,試了也是ok,你會不會是有設定錯誤 09/22 21:46
n666160: 你引用的lib是debug用的還是release用的? 09/23 02:58
bdvstg: 你的圖有放對位置? 要不要先試試絕對路徑? 09/23 08:07
VSei: 試試看是不是這個, http://goo.gl/2jR2wy 09/23 08:17
zxgpkm: 最終成功,重開新專案將環境變數全改x86忽略x64謝各位幫忙 09/23 13:05