J'ai installé gcc-4.8 sur Ubuntu 16.04 pour construire un programme C++ 11. J'ai un fichier CMakeList.txt
qui a bien fonctionné sur OS X avec Clang et GCC 4.8 construit à partir de Macports.gcc-4.8 ne peut pas compiler le programme de test?
J'ai commencé par la mise en CXX=/usr/bin/gcc-4.8
puis CMake échoue avec l'erreur suivante:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/gcc-4.8
-- Check for working CXX compiler: /usr/bin/gcc-4.8 -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCXXCompiler.cmake:54 (message):
The C++ compiler "/usr/bin/gcc-4.8" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: /home/ruipacheco/databaseclient/cpp/ninja/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_5df0c/fast"
/usr/bin/make -f CMakeFiles/cmTC_5df0c.dir/build.make
CMakeFiles/cmTC_5df0c.dir/build
make[1]: Entering directory
'/home/ruipacheco/databaseclient/cpp/ninja/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_5df0c.dir/testCXXCompiler.cxx.o
/usr/bin/gcc-4.8 -o CMakeFiles/cmTC_5df0c.dir/testCXXCompiler.cxx.o -c
/home/ruipacheco/databaseclient/cpp/ninja/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
gcc-4.8: error trying to exec 'cc1plus': execvp: No such file or directory
CMakeFiles/cmTC_5df0c.dir/build.make:65: recipe for target
'CMakeFiles/cmTC_5df0c.dir/testCXXCompiler.cxx.o' failed
make[1]: *** [CMakeFiles/cmTC_5df0c.dir/testCXXCompiler.cxx.o] Error 1
make[1]: Leaving directory
'/home/ruipacheco/databaseclient/cpp/ninja/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_5df0c/fast' failed
make: *** [cmTC_5df0c/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:6 (project)
-- Configuring incomplete, errors occurred!
Encore une fois, je sais que gcc-4.8
est capable de construire 11 programmes C++ et je l'ai réussi à faire fonctionner ce fichier CMakeLists.txt
avec gcc 4.8 sur OSX alors qu'est-ce que je pourrais manquer? "Gcc-4.8" est un compilateur C, pas un compilateur C++.
Peut-être que le support regex? –
La prise en charge de C++ 11 avant la version 5 était encore incomplète. Quelle est la raison pour laquelle vous avez décidé d'une version aussi ancienne (jusqu'à maintenant 7)? –
S'il vous plaît [Modifier] votre question pour fournir un [mcve]. –