Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 7 使用MinGW和Eclipse CDT制作CMake_Windows 7_Cmake_Eclipse Cdt_Mingw32 - Fatal编程技术网

Windows 7 使用MinGW和Eclipse CDT制作CMake

Windows 7 使用MinGW和Eclipse CDT制作CMake,windows-7,cmake,eclipse-cdt,mingw32,Windows 7,Cmake,Eclipse Cdt,Mingw32,我正在尝试在Windows7(64位)上使用Cmake编译OpenCV。它将与Eclipse和CDT一起使用,我在某处读到,无论编译器如何,都必须指定Unix Makefiles。 现在,考虑到我也有cygwin(用于Android NDK的东西),我首先尝试使用它的编译器,我成功地配置了CMake并生成了makefiles,但当OpenCV出现错误(关于ffmpeg和HMODULE)时,只得到了63%的编译。所以我切换到了MinGW(HelloWorld也很痛苦,我必须指定MinGW g++的

我正在尝试在Windows7(64位)上使用Cmake编译OpenCV。它将与Eclipse和CDT一起使用,我在某处读到,无论编译器如何,都必须指定Unix Makefiles。 现在,考虑到我也有cygwin(用于Android NDK的东西),我首先尝试使用它的编译器,我成功地配置了CMake并生成了makefiles,但当OpenCV出现错误(关于ffmpeg和HMODULE)时,只得到了63%的编译。所以我切换到了MinGW(HelloWorld也很痛苦,我必须指定MinGW g++的完整路径,不管路径变量设置如何),但现在我甚至无法配置CMake。我得到以下错误:

The C compiler identification is GNU
The CXX compiler identification is GNU
CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not found. Please set         CMAKE_RC_COMPILER to a valid compiler path or name.
Check for working C compiler: C:/MinGW/bin/gcc.exe
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeRCInformation.cmake:22 (GET_FILENAME_COMPONENT):
get_filename_component called with incorrect number of arguments
Call Stack (most recent call first):
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake:59 (enable_language)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/Platform/Windows-GNU-C.cmake:1 (include)
C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeCInformation.cmake:56 (INCLUDE)
CMakeLists.txt:2 (PROJECT)

CMake Error: CMAKE_RC_COMPILER not set, after EnableLanguage
CMake Error: Internal CMake error, TryCompile configure of cmake failed
Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "C:/MinGW/bin/gcc.exe" is not able to compile a simple test program.

It fails with the following output:

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:47 (project)

Configuring incomplete, errors occurred!

如果有人知道可能存在什么问题(与cygwin shell冲突?),我将非常感谢您的任何意见。提前谢谢

此错误消息文本:

CMake Error: your RC compiler: "CMAKE_RC_COMPILER-NOTFOUND" was not found.
  Please set CMAKE_RC_COMPILER to a valid compiler path or name.
指示“windres”(用于基于mingw和cygwin gcc的生成树)不在路径中


windres支持,用于编译Windows资源(*.rc)文件最近添加到CMake 2.8.4中。可能windres在您的MinGW环境中不可用?

我们在“Unix Makefiles”生成器中遇到了相同的问题。我们使用“MSYS Makefiles”生成器解决了这个问题(MSYS是MinGW周围的一个shell环境,就像[一个非常小的]cygwin)。

实际上,windres在那里,它的目录与MinGW make的目录相同,包含在PATH中。但您指出的问题可能与编译HelloWorld时必须包含MinGW的完整路径这一事实有关,而不管路径设置如何。无论如何,看起来鲁迪的解决方案成功了,至少现在是这样。谢谢,成功了!我想我在Eclipse CDT上发现的关于UNIX文件的信息已经过时了,而且我被可用的CDT选项误导了,没有考虑其他的选择。OpenCV已编译,希望它现在能在Eclipse中工作。干杯