2016-06-14 163 views
0

我試圖根據https://chromium.googlesource.com/breakpad/breakpad/的文檔構建breakpad庫,但是當我執行./configure && make, 時檢查C++ 11時出現錯誤,即使我目前能夠編譯與C++ 11。嘗試構建庫時出錯

這裏是從./configure輸出:

checking build system type... x86_64-pc-linux-gnu 
checking host system type... x86_64-pc-linux-gnu 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... /bin/mkdir -p 
checking for gawk... no 
checking for mawk... mawk 
checking whether make sets $(MAKE)... yes 
checking whether make supports nested variables... yes 
checking whether UID '0' is supported by ustar format... yes 
checking whether GID '0' is supported by ustar format... yes 
checking how to create a ustar tar archive... gnutar 
checking whether to enable maintainer-specific portions of Makefiles... no 
checking for style of include used by make... GNU 
checking for gcc... gcc 
checking whether the C compiler works... yes 
checking for C compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... no 
checking for suffix of object files... o 
checking whether we are using the GNU C compiler... yes 
checking whether gcc accepts -g... yes 
checking for gcc option to accept ISO C89... none needed 
checking whether gcc understands -c and -o together... yes 
checking dependency style of gcc... gcc3 
checking for ar... ar 
checking the archiver (ar) interface... ar 
checking dependency style of gcc... gcc3 
checking for gcc... (cached) gcc 
checking whether we are using the GNU C compiler... (cached) yes 
checking whether gcc accepts -g... (cached) yes 
checking for gcc option to accept ISO C89... (cached) none needed 
checking whether gcc understands -c and -o together... (cached) yes 
checking dependency style of gcc... (cached) gcc3 
checking how to run the C preprocessor... gcc -E 
checking for g++... g++ 
checking whether we are using the GNU C++ compiler... yes 
checking whether g++ accepts -g... yes 
checking dependency style of g++... gcc3 
checking for ranlib... ranlib 
checking for grep that handles long lines and -e... /bin/grep 
checking for egrep... /bin/grep -E 
checking for ANSI C header files... yes 
checking for special C compiler options needed for large files... no 
checking for _FILE_OFFSET_BITS value needed for large files... no 
checking for the pthreads library -lpthreads... no 
checking whether pthreads work without any flags... no 
checking whether pthreads work with -Kthread... no 
checking whether pthreads work with -kthread... no 
checking for the pthreads library -llthread... no 
checking whether pthreads work with -pthread... yes 
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE 
checking if more special flags are required for pthreads... no 
checking for sys/types.h... yes 
checking for sys/stat.h... yes 
checking for stdlib.h... yes 
checking for string.h... yes 
checking for memory.h... yes 
checking for strings.h... yes 
checking for inttypes.h... yes 
checking for stdint.h... yes 
checking for unistd.h... yes 
checking a.out.h usability... yes 
checking a.out.h presence... yes 
checking for a.out.h... yes 
checking whether g++ supports C++11 features by default... no 
checking whether g++ supports C++11 features with -std=c++11... no 
checking whether g++ supports C++11 features with -std=c++0x... no 
checking whether g++ supports C++11 features with +std=c++11... no 
checking whether g++ supports C++11 features with -h std=c++11... no 
configure: error: *** A compiler with support for C++11 language features is required. 

這裏是從g++ --version輸出:

g++ (Debian 4.7.2-5) 4.7.2 
Copyright (C) 2012 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

,這裏是一個示例應用程序用C++ 11編譯:

g++ -std=c++11 -g -c -pedantic -Wall -Wextra -I../boost_1_57_0 -L../boost_1_57_0/stage/lib UtilsText.cpp -o UtilsText.o 
g++ -std=c++11 -g -c -pedantic -Wall -Wextra -I../boost_1_57_0 -L../boost_1_57_0/stage/lib UtilsWeb.cpp -o UtilsWeb.o 
g++ -std=c++11 -g -c -pedantic -Wall -Wextra -I../boost_1_57_0 -L../boost_1_57_0/stage/lib WorkElement.cpp -o WorkElement.o 

我不知道爲什麼breakpad抱怨我的g ++沒有支持對於c + + 11,或者如果有一種方法,我可以重寫或添加額外的參數,以便它正確地檢測我的編譯器。

任何有關我可能會錯過或做錯的提示? breakpad是否使用可能安裝在我的系統中的另一個gcc?

這裏是的config.log文件:http://pastebin.com/TuHrmiLv

+0

如果您檢查'config.log'它說了什麼?它應該顯示用於嘗試和編譯的實際命令。 –

+0

@JoachimPileborg我已經添加了一個指向配置日誌文件的鏈接。它在測試gcc時有幾個錯誤,但它似乎在使用正確的版本。有小費嗎? – BlunT

回答

1

雖然GCC 4.7確實有一些C++ 11噸的能力,這是嚴重缺乏的大部分所需的所有功能。因此,雖然配置腳本使用正確的選項來啓用C++ 11,但編譯器實際上無法處理測試程序,因爲它使用的是舊版GCC 4.7版中不具備的功能。

如果您想使用Breakpad,您需要支持舊編譯器的舊版Breakpad,或者您需要將編譯器更新爲更新的版本。 5系列應該完全支持C++ 11。

+0

謝謝!我不得不將其他軟件庫添加到我的debian系統中,以便能夠安裝gcc 5,它不在主存儲庫中。彙編成功! – BlunT