由C 11库拒绝的AutoConf被编译器接受,被预处理器拒绝
Autoconf rejected by C++11 library accepted by compiler, reject by preprocessor
我正在尝试将Rapidcheck集成到现有的C 代码库中。README表示,它需要C 11,并严重依赖其功能。现有代码库使用Automake来构建所有依赖关系。这是我将依赖项添加到 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],[], [])],
[])
这是我运行配置脚本时遇到的错误:
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
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.
我认为这与没有最新的C 编译器有关。
这是我已经安装的C 版本:
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.
我认为是C 11兼容。
这与 automake
无关,它与 autoconf
有关。
特别是,您应该能够忽略此警告,因为AutoConf比预处理器更好地接受编译器输出。正如某人在评论中已经说过的那样,CPPFLAGS
应用于通过-I
标志来找到预处理器以找到标题,但是在这种情况下,鉴于这些标志根本不应在configure.ac
中设置(而是BE BE),这确实不是很重要(由于安装位置由用户定义,因此从外部传递。)
相关文章:
- #定义c-预处理器常量..我做错了什么
- 预处理器:插入结构名称中的前一个行号
- 如何在c++中实现处理器调度模拟器
- 访问被拒绝后,c++中的故障保护代码
- C/C++预处理器是否可以检测一些编译器选项
- 要与"if constexpr"一起使用的编译时消息(在预处理器之后)
- 在clang++预处理器中确定gcc工具链版本
- IpOpt拒绝解决不受约束的问题
- Termux权限被拒绝
- 不同/较旧的处理器运行c++代码的方式是否不同
- 用于交叉编译和CMake的预处理器宏的单元测试
- AWS Lambda C++运行时权限被拒绝
- 有没有办法在从编译器获取参数时避免预处理器宏?
- 如何比较两个同名的预处理器宏?
- WinSock2:connect() 提供"连接被拒绝"
- 从预处理器获取 Windows 版本(C++ Win32)
- 为什么 KMS drmModeSetCrtc() 在 X11 会话中运行时会失败并被拒绝权限?
- 如何摆脱为条件编译定义预处理器宏的需要?
- 删除目录函数访问被拒绝
- 由C 11库拒绝的AutoConf被编译器接受,被预处理器拒绝