cmake 3.0.2 на Debian 8.11 сошел с ума? (Обновлено) - PullRequest
0 голосов
/ 05 октября 2019

обновление: независимо от версии cmake (пробовал 3.0.2 и 3.15.4) и gcc, проблема возникает, когда проект находится в общей папке на хост-компьютере (хост - Debian 9, а guest - Debian 8),Возникла проблема при обновлении одного из: VirtualBox 6.0.12 или guestAdditions 0.20.0 или vagrant 2.2.5, и, возможно, это связано с изменением времени выполнения или различными привилегиями при монтировании)


проблема возникает как сстарые и только что созданные виртуальные машины Debian 8, старая виртуальная машина работала месяцами, и у нее внезапно возникла эта проблема, создание новой виртуальной машины дает то же самое. CMake больше не может найти компиляторы c / c ++, даже если gcc 4.9.2 запущен и файлы a.out созданы из примеров программ на c / c ++.

  • ОС Debian jessie 8.11 (VirtualBox6.0.12, созданная с помощью vagrant 2.2.5)
  • cmake версия 3.0.2
  • gcc (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;
}

my CMakeLists.txt:

project (hello)
add_executable(hello helloworld.cpp)

Запуск 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".
...