Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu CMake在简单测试程序中失败_Ubuntu_Cmake_Compiler Errors_Compilation - Fatal编程技术网

Ubuntu CMake在简单测试程序中失败

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

我在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 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)
行需要放在
项目()的前面