【发布时间】:2010-06-21 19:58:50
【问题描述】:
我正在制作一个使用 Autoconf 的项目。我在configure.ac 中有以下内容:
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.
这很奇怪,因为我有 Boost。如果我删除检查,代码编译,我安装了 Boost:
$ 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
【问题讨论】:
-
检查 config.log 以了解失败的确切原因。 AcademicRobot 可能是正确的,它正在尝试使用 C 编译器进行编译。