lundi 27 juin 2016

Autoconf rejected by C++11 library accepted by compiler, reject by preprocessor

I'm trying to integrate rapidcheck into an existing C++ codebase. The README says it requires C++11 and relys heavily on its features. The codebase I am integrating it into uses automake to build all of the dependencies. Here is how I am adding the dependency inside of 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 run the config file

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.

Aucun commentaire:

Enregistrer un commentaire