我正在尝试使用OpenCV for Java Desktop(自2013年2月15日起可用)做一个简单的人脸识别项目(用于研究目的),我在Windows中构建OpenCV有问题。
我遵循这个教程,我在构建部分卡住了,你需要生成一个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,但它返回相同的错误。
您不需要向CMake指定MinGW的位置,因为它在PATH环境变量中。如果你想安装支持Java桌面的OpenCV 2.4.4,你不需要编译所有的源代码,只需要从这里下载可执行文件(你提到的教程中也有指定)并将其解压缩到你想要安装它的目录。就是这样。
为Java编译Opencv在以前的版本中是必要的,当它是实验性的。