0

CMake を使用して Windows で CodeBlocks をコーディングしようとしています。

Cygwinコンソール内で私は:

cmake .. -G"CodeBlocks - Unix Makefiles"

出力は次のとおりです。

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:D:/sources/tests/testOSG/build_CodeBlocks/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:D:/sources/tests/testOSG/build_CodeBlocks/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

問題のある変数を設定しようとしましたが、結果は同じです:

set CMAKE_MAKE_PROGRAM=C:/Progra~2/CodeBlocks/MinGW/bin/mingw32-make.exe
set CMAKE_C_COMPILER=C:/Progra~2/Microsoft Visual Studio 10.0/VC/bin/cl.exe
set CMAKE_CXX_COMPILER=C:/Progra~2/Microsoft Visual Studio 10.0/VC/bin/cl.exe

それを機能させる方法はありますか?

編集:コンパイラへのパスを追加すると役立ちますが、まだエラーがあります:

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Defining WIN32 under Cygwin due to CMAKE_LEGACY_CYGWIN_WIN32
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/cl.exe -- broken
CMake Error at /usr/share/cmake-2.8.9/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  10.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /cygdrive/d/sources/tests/testOSG/build_CodeBlocks/CMakeFiles/CMakeTmp

  Run Build Command:C:/Program\ Files\
  (x86)/CodeBlocks/MinGW/bin/mingw32-make.exe
  "cmTryCompileExec437970983/fast"

  C:/Program Files (x86)/CodeBlocks/MinGW/bin/mingw32-make -f
  CMakeFiles/cmTryCompileExec437970983.dir/build.make
  CMakeFiles/cmTryCompileExec437970983.dir/build

  /usr/bin/sh: -c: line 0: Erreur de syntaxe près du symbole inattendu « (
  »

  /usr/bin/sh: -c: line 0: `C:/Program Files
  (x86)/CodeBlocks/MinGW/bin/mingw32-make -f
  CMakeFiles/cmTryCompileExec437970983.dir/build.make
  CMakeFiles/cmTryCompileExec437970983.dir/build'

  mingw32-make: *** [cmTryCompileExec437970983/fast] Error 1

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

-- Configuring incomplete, errors occurred!
4

3 に答える 3

2

「MinGW Installation Manager」から「基本セットアップ」をインストールした可能性があります。パッケージ名「mingw-gcc-g++」のGNU C++コンパイラはインストールされないため、「bin」と「dev」を選択して手動でインストールする必要があります。これは私にとってはうまくいきました。

于 2014-02-10T09:49:51.040 に答える
0

コンパイラ (MinGw-gcc.exe など) を含むディレクトリが PATH にあることを確認してから、もう一度コンソールを起動して、cmake を再度実行してみてください。

于 2013-02-22T14:36:00.597 に答える