无法使用CMAKE构建Makefile,未指定编译器 [英] Can't build a Makefile with CMAKE, compiler is not specified

查看:765
本文介绍了无法使用CMAKE构建Makefile,未指定编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Java Desktop的OpenCV(自2013年2月15日开始可用)来做一个简单的人脸识别项目(出于学习目的),并且在Windows中构建OpenCV时遇到问题. /p>

我正在关注教程, 而我陷入了构建部分,您需要在其中生成一个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,但它返回了相同的错误.

谢谢.

解决方案

由于MinGW位于PATH环境变量中,因此无需将其指定为CMake. 如果要安装支持Java Desktop的OpenCV 2.4.4,则不需要编译所有源代码,只需从tutorial , and i got stuck in the build part, where you need to generate a Makefile.

I executed the command below(as the tutorial says):

cmake -DBUILD_SHARED_LIBS=OFF

and got the following error:

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:

I'm a newbie in C, but i think it might be a problem with my compiler, i have MinGW installed, but i don't know how to specify to CMake where he is.

I also tried to run the CMake GUI, but it returned the same error.

Thanks in advance.

解决方案

You do not need to specify to CMake where the MinGW is, since it is in PATH environment variable. If you want to install OpenCV 2.4.4 with support for Java Desktop, you do not need to compile all source, just download executable from here (also specified in tutorial that you mentioned) and extract it to the directory where you want to install it. And that is it.

Compiling Opencv for Java was necessary in previous version, when it was experimental.

这篇关于无法使用CMAKE构建Makefile,未指定编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆