【问题标题】:Missing variable cmake_3_compiler kdevelop cmake缺少变量 cmake_3_compiler kdevelop cmake
【发布时间】:2012-10-27 13:53:56
【问题描述】:

我曾经在 Linux Mint 上使用 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)

【问题讨论】:

  • 你能从Exercise 3目录显示CMakeLists.txt吗?

标签: compiler-construction cmake kdevelop


【解决方案1】:

看看project() command documentation

它的第一个参数是项目名称,其他参数是使用的语言。 CMake 认为3 是一种编程语言,并试图找到它的编译器。

从项目名称中删除空格或使用引号:project("exercise 3")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-28
    • 2015-07-25
    相关资源
    最近更新 更多