5

Windows 7 (64 ビット) で Cmake を使用して OpenCV をコンパイルしようとしています。これは Eclipse と CDT で使用するためのもので、コンパイラに関係なく Unix の Makefile を指定する必要があるとどこかで読んだことがあります。今、私もcygwinを持っているので(Android NDKのもののために)、最初にそのコンパイラを使ってみました.CMakeをうまく設定してmakefileを生成しましたが、OpenCVがエラーを吐いたとき(ffmpegとについて)コンパイルの63%にしか達しませんでしたHモジュール)。それでMinGWに切り替えました(HelloWorldも面倒で、PATH変数の設定に関係なく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 シェルとの競合?) を誰かが知っている場合は、入力していただければ幸いです。前もって感謝します!

4

2 に答える 2

6

「Unix Makefiles」ジェネレーターで同じ問題に遭遇しました。「MSYS Makefiles」ジェネレーターを使用して解決しました (Msys は、[非常に小さな] cygwin のような MinGW 周辺のシェル環境です)。

于 2011-03-04T11:12:40.710 に答える
3

このエラー メッセージ テキスト:

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 ベースのビルド ツリー用) が PATH にないことを示します。

Windows リソース (*.rc) ファイルをコンパイルするための windres サポートは、最近 CMake 2.8.4 で追加されました。あなたのMinGW環境でwindresが利用できないのではないでしょうか?

于 2011-03-04T11:00:09.170 に答える