1
我試圖將rapidcheck集成到現有的C++代碼庫中。 README表示它需要C++ 11並且嚴重依賴其功能。現有的代碼庫使用automake來構建所有的依賴關係。這裏是我正在添加的依賴到configure.ac
:Autoconf由編譯器接受的C++ 11庫拒絕,被預處理器拒絕
CXXFLAGS="$CXXFLAGS -Wall -Werror -Wno-missing-braces -std=c++11"
CXXFLAGS="$CXXFLAGS -I/home/chris/dev/rapidcheck/include"
CXXFLAGS="$CXXFLAGS -I/home/chris/dev/rapidcheck/include/rapidcheck"
AC_CHECK_HEADERS(
[rapidcheck.h],
[AC_CHECK_LIB([rapidcheck], [main],[], [])],
[])
這裏是我得到的錯誤,當我運行配置腳本:中config.log
3501 configure:22873: checking rapidcheck.h usability
3502 configure:22873: g++ -std=c++11 -c -g -O2 -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wall -Werror -Wno-missing-braces -std=c++11 -I/home/chris/dev/rapidcheck/include -I/home/chris /dev/rapidcheck/include/rapidcheck -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS conftest.cpp >&5
3503 configure:22873: $? = 0
3504 configure:22873: result: yes
3505 configure:22873: checking rapidcheck.h presence
3506 configure:22873: g++ -std=c++11 -E -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS conftest.cpp
3507 conftest.cpp:58:24: fatal error: rapidcheck.h: No such file or directory
3508 compilation terminated.
我
checking rapidcheck.h usability... yes
checking rapidcheck.h presence... no
configure: WARNING: rapidcheck.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: rapidcheck.h: proceeding with the compiler's result
checking for rapidcheck.h... yes
checking for main in -lrapidcheck... no
內容認爲這與沒有最新的C++編譯器有關。
這裏是C的++版本我已經安裝:
[email protected]:~/dev/bitcoin$ g++ --version
g++ (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3
Copyright (C) 2015 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兼容。
gcc 4.9確實具有合理但不完整的C++ 11支持。 –
所以我需要升級到另一個版本?什麼是我應該升級到的最低版本? –
我會說5.3。當前版本的gcc是6.1 –