我正在做一个使用Autoconf的项目。 我有configure.ac的以下内容:
AC_CHECK_HEADERS([boost/foreach.hpp],[],[AC_MSG_ERROR(You need the Boost libraries.)])
checking boost/foreach.hpp usability... no checking boost/foreach.hpp presence... no checking for boost/foreach.hpp... no configure: error: You need the Boost libraries.
这很奇怪,因为我有Boost。 如果我删除检查,代码编译,我已经安装了Boost:
$ find /usr/include -name foreach.hpp /usr/include/boost/foreach.hpp /usr/include/boost/test/utils/foreach.hpp
请注意,我对SDL完全一样,它的工作原理。
在Ubuntu 11.04上的autoconf错误
通过Makefile构build和构build脚本工作,但与等效的Makefile.am没有(给出未定义的引用错误)
autoconfconfiguration结果在C std lib头相关的编译错误
如何准备./configure make make安装我的C文件时,它有其他的依赖?
GNU自动工具:将二进制文件安装到/ bin,/ sbin,/ usr / bin和/ usr / sbin中,与–prefix和DESTDIR
AC_CHECK_HEADERS([SDL/SDL.h],[AC_MSG_ERROR(You need the SDL development library.)])
…
checking SDL/SDL.h usability... yes checking SDL/SDL.h presence... yes checking for SDL/SDL.h... yes
如何避免重新定义VERSION,PACKAGE等
在GNU / Linux系统上,我应该从哪里加载应用程序数据?
如何在python中自动安装缺less的模块?
autoconf在Linux Mint上抱怨“C编译器无法创build可执行文件”
AC_CHECK_HEADERS实际上做一个编译检查,而不是存在检查。 所以你必须设置C ++对编译测试的支持才能编译boost头文件(这里默认是C, docs ):
AC_LANG_PUSH([C++]) AC_CHECK_HEADERS([boost/foreach.hpp],[AC_MSG_ERROR(You need the Boost libraries.)]) AC_LANG_POP([C++])
不是一个真正的答案 – 尝试boost.m4如果你想用autoconf Boost。
在GNU Autoconf Archive上还有一组Boost的autoconf宏。 您可能至少需要AX_BOOST_BASE 。 其他Boost库的其他宏也在那里。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。