Ubuntu CMake在简单测试程序中失败
我在Xubuntu19.10上,试图编译一个程序。几天前它还在工作,但在重新启动我的计算机后,由于某种原因,我的Ubuntu CMake在简单测试程序中失败,ubuntu,cmake,compiler-errors,compilation,Ubuntu,Cmake,Compiler Errors,Compilation,我在Xubuntu19.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
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\u TRY\u COMPILE\u TARGET\u TYPE“STATIC\u LIBRARY”)
或set(CMAKE\u C\u COMPILER\u WORKS 1)
SET(CMAKE\u CXX\u COMPILER\u WORKS 1)
但我仍然得到相同的错误 我将这些项目放在CMakeLists.txt
文件的错误部分的底部。SET(CMAKE\u C\u COMPILER\u WORKS 1)
和SET(CMAKE\u CXX\u COMPILER\u WORKS 1)
行需要放在项目()的前面