Reputation: 1689
I'm trying to integrate rapidcheck into an existing C++ codebase. The README says it requires C++11 and relies heavily on its features. The existing codebase uses automake to build all of the dependencies. Here is how I am adding the dependency into configure.ac
:
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],[], [])],
[])
Here is the error I am getting when I run the configure script:
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
contents of 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.
I think it has something to do with not having an up to date C++ compiler.
Here is the version of C++ I have installed:
chris@chris:~/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.
Which I THINK is C++11 compatible.
Upvotes: 2
Views: 3434
Reputation: 3240
This has nothing to do with automake
, it has to do with autoconf
.
In particular, you should be able to ignore this warning in general because autoconf accepts the compiler output better than the preprocessor. As someone already said in the comments, CPPFLAGS
should be used to pass -I
flags for the preprocessor to find the headers, but in this case it's really not that important, given that those flags should not be set in configure.ac
at all (but rather be passed from the outside since the install location is defined by the user.)
Upvotes: 3