【发布时间】:2019-11-02 20:19:21
【问题描述】:
我在 Xubuntu 19.10 上并试图编译一个程序。几天前它还在工作,但是在重新启动我的计算机后,由于某种原因我的build 目录消失了。我正在尝试重新制作它,但 cmake .. 上的事情失败了。我得到的错误是
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/bojohnson/Documents/MagPhyxP/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_77531/fast"
CMake Error: The source directory "/home/bojohnson/Documents/MagPhyxP/build/CMakeFiles/CMakeTmp/cmTC_77531/fast" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
See also "/home/bojohnson/Documents/MagPhyxP/build/CMakeFiles/CMakeOutput.log".
See also "/home/bojohnson/Documents/MagPhyxP/build/CMakeFiles/CMakeError.log".
我已经尝试了针对此问题找到的多个其他建议,例如 set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") 或 SET (CMAKE_C_COMPILER_WORKS 1) 和
SET (CMAKE_CXX_COMPILER_WORKS 1) 但我仍然遇到同样的错误。
【问题讨论】:
标签: ubuntu cmake compiler-errors compilation