3

以前はLinuxMintでKdevelopを使用していましたが、これは問題なく機能しました。Linuxを再インストールしましたが、Kdevelopとcmakeを動作させることができません。

コンパイルすると、次のエラーが発生します。

make: *** No targets specified and no makefile found.  Stop.

そして、cmakeを設定しようとすると、次のようになります。

/home/benedikt/projects/Exercise 3/build> /usr/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Debug /home/benedikt/projects/Exercise 3/  
-- Configuring incomplete, errors occurred!  
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.  
Missing variable is:  
CMAKE_3_COMPILER_ENV_VAR  
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.  
Missing variable is:  
CMAKE_3_COMPILER  
CMake Error: Could not find cmake module file:/home/benedikt/projects/Exercise 3/build/CMakeFiles/CMake3Compiler.cmake  
CMake Error: Could not find cmake module file:CMake3Information.cmake  
CMake Error: CMAKE_3_COMPILER not set, after EnableLanguage 

変数を何に設定する必要があり、どこでそれを行うのですか?

編集:CMakeList.txtは次のとおりです。

project(exercise 3)

add_executable(exercise 3 main.cpp)
4

1 に答える 1

2

project() コマンドのドキュメントをご覧ください。

最初の引数はプロジェクト名で、その他は使用言語です。CMake はそれ3をプログラミング言語と見なし、そのコンパイラを見つけようとします。

プロジェクト名からスペースを削除するか、引用符を使用してください: project("exercise 3").

于 2012-10-27T17:14:03.523 に答える