【问题标题】:Can't build a Makefile with CMAKE, compiler is not specified无法使用 CMAKE 构建 Makefile,未指定编译器
【发布时间】:2013-02-26 18:33:25
【问题描述】:

我正在尝试使用 OpenCV for Java Desktop(自 2013 年 2 月 15 日起可用)来做一个简单的人脸识别项目(用于学习目的),我在 Windows 中构建 OpenCV 时遇到了问题。

我正在关注这个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,但它返回了相同的错误。

提前致谢。

【问题讨论】:

标签: c windows opencv makefile cmake


【解决方案1】:

您无需向 CMake 指定 MinGW 所在的位置,因为它位于 PATH 环境变量中。 如果要安装支持 Java Desktop 的 OpenCV 2.4.4,则无需编译所有源代码,只需从 here 下载可执行文件(也在您提到的教程中指定)并将其解压缩到您要安装的目录安装它。就是这样。

在以前的版本中,需要为 Java 编译 Opencv,当时它是实验性的。

【讨论】:

  • 非常感谢 Andriy,我仍然遇到 eclipse 环境问题,示例代码抛出异常,即使我将 jar 包含到项目中。问题是 .dll 文件。再次感谢您。
猜你喜欢
  • 2012-10-14
  • 2016-07-10
  • 1970-01-01
  • 1970-01-01
  • 2016-09-09
  • 2019-10-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多