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
Gcc Debian 8.11上的cmake 3.0.2疯了吗?(更新)_Gcc_Cmake_Debian - Fatal编程技术网

Gcc Debian 8.11上的cmake 3.0.2疯了吗?(更新)

Gcc Debian 8.11上的cmake 3.0.2疯了吗?(更新),gcc,cmake,debian,Gcc,Cmake,Debian,更新: 无论是在cmake版本(试用了3.0.2和3.15.4)还是gcc上, 当项目位于主机上的共享文件夹上时,就会出现问题 (主机是Debian 9,来宾是Debian 8),更新VirtualBox 6.0.12或guestAdditions 0.20.0或vagrant 2.2.5中的一个时出现问题,可能与更改的时间执行或装载中的不同权限有关) 老的和刚创建的Debian8VM都会出现这个问题 旧的虚拟机工作了好几个月,突然出现了这个问题,创建一个全新的虚拟机也会出现同样的问题。 即使

更新: 无论是在cmake版本(试用了3.0.2和3.15.4)还是gcc上, 当项目位于主机上的共享文件夹上时,就会出现问题 (主机是Debian 9,来宾是Debian 8),更新VirtualBox 6.0.12或guestAdditions 0.20.0或vagrant 2.2.5中的一个时出现问题,可能与更改的时间执行或装载中的不同权限有关)


老的和刚创建的Debian8VM都会出现这个问题 旧的虚拟机工作了好几个月,突然出现了这个问题,创建一个全新的虚拟机也会出现同样的问题。 即使GCC4.9.2已经启动并运行,CMake也无法再找到c/c++编译器 和a.out文件是从示例c/c++程序创建的

  • OS Debian jessie 8.11(使用vagrant 2.2.5创建的VirtualBox 6.0.12)
  • cmake版本3.0.2
  • 通用条款(Debian 4.9.2-10+deb8u2)4.9.2
my helloworld.cpp:

#include <iostream>
#include <string>

int main(int argc, char *argv[]){
   std::cout << "Hello World!" << std::endl;
   return 0;
}
运行cmake

$ cmake .
-- The C compiler identification is GNU 4.9.2
CMake Error at /usr/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake:172 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- The CXX compiler identification is GNU 4.9.2
CMake Error at /usr/share/cmake-3.0/Modules/CMakeDetermineCXXCompiler.cmake:170 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- Check for working C compiler: /usr/bin/cc
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
  Unknown extension ".c" for file

    <my-project-dir>/CMakeFiles/CMakeTmp/testCCompiler.c

  try_compile() works only for enabled languages.  Currently these are:

    C CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- Configuring incomplete, errors occurred!
See also "<my-project-dir>/CMakeFiles/CMakeOutput.log".
See also "<my-project-dir>/CMakeFiles/CMakeError.log".
$cmake。
--C编译器标识为GNU4.9.2
CMake错误位于/usr/share/CMake-3.0/Modules/cmakeedetermineccompiler.CMake:172(配置文件):
配置\u文件配置文件时出现问题
调用堆栈(最新调用优先):
CMakeLists.txt:1(项目)
--CXX编译器标识为GNU 4.9.2
CMake错误位于/usr/share/CMake-3.0/Modules/cmakeedeterminecxxcompiler.CMake:170(配置文件):
配置\u文件配置文件时出现问题
调用堆栈(最新调用优先):
CMakeLists.txt:1(项目)
--检查C编译器是否工作:/usr/bin/cc
CMake错误位于/usr/share/CMake-3.0/Modules/CMakeTestCCompiler。CMake:47(尝试编译):
文件的扩展名“.c”未知
/cmakfiles/cmakemp/testCCompiler.c
try_compile()仅适用于启用的语言。目前有:
CXX
请参见project()命令以启用其他语言。
调用堆栈(最新调用优先):
CMakeLists.txt:1(项目)
--检查C编译器是否工作:/usr/bin/cc--已损坏
CMake错误位于/usr/share/CMake-3.0/Modules/CMakeTestCCompiler。CMake:61(消息):
C编译器“/usr/bin/cc”无法编译简单的测试程序。
它失败,输出如下:
CMake将无法正确生成此项目。
调用堆栈(最新调用优先):
CMakeLists.txt:1(项目)
--配置不完整,出现错误!
另请参见“/cmakfiles/CMakeOutput.log”。
另请参见“/CMakeFiles/CMakeError.log”。

这可能是不相关的,但是在调用
project()
之前使用
cmake_minimum_required
是一种很好的基调,可以防止许多奇怪的问题。添加cmake_minimum_required(版本3.0.2)作为第1行的结果完全相同
$ cmake .
-- The C compiler identification is GNU 4.9.2
CMake Error at /usr/share/cmake-3.0/Modules/CMakeDetermineCCompiler.cmake:172 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- The CXX compiler identification is GNU 4.9.2
CMake Error at /usr/share/cmake-3.0/Modules/CMakeDetermineCXXCompiler.cmake:170 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- Check for working C compiler: /usr/bin/cc
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:47 (try_compile):
  Unknown extension ".c" for file

    <my-project-dir>/CMakeFiles/CMakeTmp/testCCompiler.c

  try_compile() works only for enabled languages.  Currently these are:

    C CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)


-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/share/cmake-3.0/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/usr/bin/cc" is not able to compile a simple test program.

  It fails with the following output:


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- Configuring incomplete, errors occurred!
See also "<my-project-dir>/CMakeFiles/CMakeOutput.log".
See also "<my-project-dir>/CMakeFiles/CMakeError.log".