簡體   English   中英

openCV與Visual Studio 2013集成的問題

[英]openCV Integration with Visual Studio 2013 issue

首先,感謝您的閱讀。 我經歷了很多有關如何在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";

在打開的位置安裝。

這是我的代碼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;
}

vc11用於VS2012,對於VS2013,您應該使用vc12

對於您的情況,請更改

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

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

ps:還要確保您的項目在x64平台下構建。

我正在閱讀,上面的行並不表示錯誤。 而錯誤-1是另一個錯誤,發生的原因是,如果(argc!= 2)原因實際上沒有接收任何參數(錯誤只是為了去做而不去想:P),代碼就被int了,所以給圖像作為參數就可以了完美。 抱歉打擾你們,希望對其他遇到相同問題的人有所幫助=)

除此之外,還要感謝@herohuyongtao vc11適用於VS2012,對於VS2013,您應該使用vc12。

對於您的情況,請更改

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

PATH =“ C:\\ Users \\ GASTON \\ Documents \\ opencv \\ build \\ x64 \\ vc12 \\ bin”; ps:還要確保您的項目在x64平台下構建。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM