2015-02-06 167 views
0

首先感謝閱讀。我通過了很多關於如何在VS2013中安裝openCV的教程。我認爲我正確執行了所有步驟,但最終當我運行控制檯的Win32應用程序C++我得到這個錯誤:openCV與Visual Studio 2013問題集成

'openCV.exe' (Win32): Loaded 'C:\Users\GASTON\Documents\Visual Studio 2013\Projects\openCV\x64\Debug\openCV.exe'. Symbols loaded. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Users\GASTON\Documents\opencv\build\x64\vc11\bin\opencv_highgui2410d.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Users\GASTON\Documents\opencv\build\x64\vc11\bin\opencv_core2410d.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msvcp120d.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msvcr120d.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\comctl32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msvfw32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\avifil32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\avicap32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msvcp110d.dll'. Symbols loaded. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msvcr110d.dll'. Symbols loaded. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msacm32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\version.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Cannot find or open the PDB file. 
'openCV.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Cannot find or open the PDB file. 
The program '[5168] openCV.exe' has exited with code -1 (0xffffffff). 

我不明白,爲什麼VS不能加載庫,因爲我讓所有的CONFIGS(至少我認爲)

我的全局變量是:

PATH= "C:\Users\GASTON\Documents\opencv\build\x64\vc11\bin"; 

的裝機哪裏開。

這裏是我的代碼main.cpp中

#include <opencv2/core/core.hpp> 
#include <opencv2/highgui/highgui.hpp> 
#include <iostream> 

using namespace cv; 
using namespace std; 

int main(int argc, char** argv) 
{ 
    if (argc != 2) 
    { 
     cout << " Usage: display_image ImageToLoadAndDisplay" << endl; 
     return -1; 
    } 

Mat image; 
image = imread(argv[1], IMREAD_COLOR); // Read the file 

if (!image.data) // Check for invalid input 
{ 
    cout << "Could not open or find the image" << std::endl; 
    return -1; 
} 

namedWindow("Display window", WINDOW_AUTOSIZE); // Create a window for display. 
imshow("Display window", image); // Show our image inside it. 

waitKey(0); // Wait for a keystroke in the window 
    return 0; 
} 
+1

我在讀,上面的行並不意味着錯誤。 而錯誤-1是另一個,發生導致代碼是得到INT 如果(argc!= 2)導致實際上沒有收到任何參數(錯誤只是要做,不要想:P) 因此給一個圖像因爲參數一切正常。 對不起,打擾你們,並希望這對其他人有同樣問題的幫助:P – GDedieu 2015-02-06 14:44:59

+0

您可以提交此問題作爲您自己的問題的答案。 – GPPK 2015-02-06 14:57:56

+0

即使它工作,應該這樣:PATH =「C:\ Users \ GASTON \ Documents \ opencv \ build \ x64 \ vc11 \ bin」; 與vc12? – Michele 2015-02-06 17:49:17

回答

0

vc11是VS2012,爲VS2013,你應該使用vc12

對於你的情況,改變

PATH= "C:\Users\GASTON\Documents\opencv\build\x64\vc11\bin"; 

PATH= "C:\Users\GASTON\Documents\opencv\build\x64\vc12\bin"; 

P.S:另外,還要確保你的項目按x64平臺構建。

0

我在讀,上面的行並不意味着錯誤。而錯誤-1是另一個,那happend導致代碼是得到int如果(ARGC!= 2)導致實際上沒有收到任何參數(錯誤只是爲了做,不想認爲:P)所以給圖像作爲參數一切正常完美。對不起,打擾你們,並希望這對其他人有同樣的問題=)

除了和@herohuyongtao vc11是VS2012,對於VS2013,你應該使用VC12。

對於你的情況,改變

PATH = 「C:\用戶\ GASTON \文檔\ OpenCV的\建設\ 64 \ VC11 \ BIN」; 到

PATH =「C:\ Users \ GASTON \ Documents \ opencv \ build \ x64 \ vc12 \ bin」; p.s .:也請確保您的項目是在x64平臺下構建的。