Ubuntu 16.04にgcc-4.8をインストールしてC++ 11プログラムをビルドしました。私はCMakeList.txt
ファイルをOS XでClangとGCC 4.8がMacportsから構築してうまく動作しています。gcc-4.8はテストプログラムをコンパイルできませんか?
私はCXX=/usr/bin/gcc-4.8
を設定することにより開始し、その後、CMakeのが次のエラーで失敗します。
-- 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!
、私はgcc-4.8
は、C++ 11個のプログラムを構築することが可能であり、私はこのCMakeLists.txt
ファイルを動作させるために管理している知っていますOSX上でgcc 4.8を使用すると、何が失われる可能性がありますか?
多分正規表現サポートですか? –
バージョン5より前のC++ 11のサポートはまだ不完全でした。あなたがそのような古いバージョン(これは7以上になっています)を決めた理由は何ですか? –
あなたの質問を[編集]して[mcve]を提供してください。 –