pet*_*ohn 11 linux autoconf boost
我正在制作一个使用Autoconf的项目.我有以下内容configure.ac
:
AC_CHECK_HEADERS([boost/foreach.hpp], [],
[AC_MSG_ERROR(You need the Boost libraries.)])
Run Code Online (Sandbox Code Playgroud)
当我运行时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.
Run Code Online (Sandbox Code Playgroud)
这很奇怪,因为我有Boost.如果我删除了检查,代码编译,我安装了Boost:
$ find /usr/include -name foreach.hpp
/usr/include/boost/foreach.hpp
/usr/include/boost/test/utils/foreach.hpp
Run Code Online (Sandbox Code Playgroud)
请注意,我对SDL做了完全相同的工作.
AC_CHECK_HEADERS([SDL/SDL.h], [],
[AC_MSG_ERROR(You need the SDL development library.)])
Run Code Online (Sandbox Code Playgroud)
...
checking SDL/SDL.h usability... yes
checking SDL/SDL.h presence... yes
checking for SDL/SDL.h... yes
Run Code Online (Sandbox Code Playgroud)
aca*_*bot 16
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++])
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6086 次 |
最近记录: |