2014-08-31 34 views
2

當我嘗試編譯此代碼如何爲Visual C++ 2008 x86安裝openCV 2.4.9? (解析的外部符號)

// Project0.cpp : main project file. 

#include "stdafx.h" 

using namespace System; 
#include <opencv2/core/core.hpp> 

int main(array<System::String ^> ^args) 
{ 
    return 0; 
} 

我得到38 errors and 4 warnings

我指定所有3個文件夾包含文件路徑: enter image description here

And lib files directory: enter image description here

以及debug .lib文件: enter image description here

所選的平臺是Win32和* .lib的是x86,所以我認爲問題不同於this,其中使用了x64。

我可以創建解決方案的平臺,並命名爲「64」,但我的項目不能切換到它:

enter image description here

+2

你不能鏈接到vc10庫使用vs2008,你必須使用那些從vc9文件夾(如果存在) – berak 2014-08-31 15:49:21

+0

它不存在 – user2136963 2014-08-31 15:50:09

+4

然後你必須得到cmake,並從src重新編譯。另外,在嘗試時,請幫助自己,*避免* cli/managed C++。從一個*空*項目開始 – berak 2014-08-31 15:52:29

回答

2

正如berak說,它更容易獲得一個Visual C++ 2010年要使用opencv 2.4.9與MVC++ 2008一個應該重新編譯庫來源