我正在制作一个使用Autoconf的项目。我在configure.ac
如下:Boost和Autoconf
AC_CHECK_HEADERS([boost/foreach.hpp], [],
[AC_MSG_ERROR(You need the Boost libraries.)])
当我运行configure
,它说,它无法找到这个头文件:
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.
这是奇怪的,因为我有推动作用。如果我删除了检查,代码编译,我已经安装了提升:
$ find /usr/include -name foreach.hpp
/usr/include/boost/foreach.hpp
/usr/include/boost/test/utils/foreach.hpp
请注意,我也正好与SDL一样的,它的工作原理。
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
您可能会对http://github.com/tsuna/boost.m4感兴趣,这是一组用于检查Boost标头和库以及最低Boost版本的Autoconf宏的嵌入式集合。 – ZoogieZork 2010-06-21 20:37:00
检查config.log以查看它的失败原因。 academicRobot可能是正确的,它试图用C编译器进行编译。 – 2010-06-22 04:43:50
boost.m4完美地为我工作。我能够在没有任何问题的情况下(以及在多个操作系统上)针对多个版本的boost进行构建。 – squeegee 2015-01-04 03:02:39