2013-03-11 98 views
0

我嘗試使用OpenCV for Java Desktop(自2013年2月15日起可用)做簡單的人臉識別項目(用於學習目的)和我在Windows中構建OpenCV時遇到問題。無法使用CMAKE構建Makefile,未指定編譯器

我正在關注這個tutorial, 我被困在構建部分,你需要生成一個Makefile。

我執行以下命令(作爲教程說):

cmake -DBUILD_SHARED_LIBS=OFF

,並得到了以下錯誤:

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. 
Compiler: cl 
Build flags: 
Id flags: 

The output was: 
O sistema não pode encontrar o arquivo especificado(System couldn't find the specified file). 

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. 
Compiler: cl 
Build flags: 
Id flags: -c 

The output was: 
O sistema não pode encontrar o arquivo especificado(System couldn't find the specified file) 

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. 
Compiler: cl 
Build flags: 
Id flags: 

The output was: 
O sistema não pode encontrar o arquivo especificado(System couldn't find the specified file). 

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. 
Compiler: cl 
Build flags: 
Id flags: -c 

The output was: 
O sistema não pode encontrar o arquivo especificado(System couldn't find the specified file). 

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. 
Compiler: cl 
Build flags: 
Id flags: -Aa 

The output was: 
O sistema não pode encontrar o arquivo especificado(System couldn't find the specified file). 

Determining if the CXX compiler works failed with the following output: 

我在C新手,但我認爲它可能是我的編譯器有問題,我安裝了MinGW,但我不知道如何指定CMake在哪裏。

我也嘗試運行CMake GUI,但它返回了相同的錯誤。

在此先感謝。

+1

可能的重複http://stackoverflow.com/questions/4101456/running-cmake-on-windows – cdarke 2013-03-11 14:29:05

回答

1

因爲它在PATH環境變量中,所以不需要指定CMake MinGW所在的位置。 如果您想安裝支持Java Desktop的OpenCV 2.4.4,則無需編譯所有源代碼,只需從here(也在您提到的教程中指定)下載可執行文件並將其解壓到您要安裝的目錄它。就是這樣。

編譯Opencv for Java在以前的版本中是必需的,當時它是實驗性的。

+0

非常感謝Andriy,我仍然在eclipse環境中遇到問題,示例代碼拋出異常,甚至如果我把jar包含到項目中。問題是.dll文件。再次,我感謝你。 – 2013-03-13 20:10:13