我正在製作一個使用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