首先感谢阅读。我经历了很多关于如何在VS2013中安装openCV的教程。我想我正确地遵循了所有步骤,但最后当我运行控制台win32应用程序c ++时,我收到了这个错误:
'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无法加载库因为我做了所有的配置(至少我认为)
我的全局变量是:
PATH= "C:\Users\GASTON\Documents\opencv\build\x64\vc11\bin";
安装open的地方。
这是我的代码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;
}
答案 0 :(得分: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
平台下构建的。
答案 1 :(得分:0)
我正在阅读,上面的行不代表错误。而错误-1是另一个,发生这种情况导致代码是get int if(argc!= 2)导致实际上没有收到任何参数(错误就是这样做而不是想:P)所以给出一个图像作为参数一切正常完美。很抱歉打扰你们,希望对其他有相同问题的人有所帮助=)
此外,感谢@herohuyongtao vc11适用于VS2012,对于VS2013,您应该使用vc12。
根据您的情况,请更改
PATH =&#34; C:\ Users \ GASTON \ Documents \ opencv \ build \ x64 \ vc11 \ bin&#34 ;; 到
PATH =&#34; C:\ Users \ GASTON \ Documents \ opencv \ build \ x64 \ vc12 \ bin&#34 ;; p.s。:还要确保您的项目是在x64平台下构建的。