我正在尝试使用 autotools 编译一些代码,并且在尝试包含 boost::date-time 和 boost::regex 时卡住了。我得到了一个configure.in
文件,它定义了以这种方式查找 boost::date-time
AC_CHECK_LIB(boost_date_time-gcc-mt, main, , [
AC_CHECK_LIB(boost_date_time-mt, main, , [
AC_CHECK_LIB(boost_date_time, main, , [
AC_MSG_ERROR("Linking against boost::date-time library failed.")])
])
])
根据谷歌,这似乎是标准方式。但是当我运行 autoreconf 时:
$ autoreconf -f -s -i
libtoolize: putting auxiliary files in `.'.
libtoolize: linking file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.in and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
和./配置:
$ CXXFLAGS="-g -w" ./configure --prefix=$INSTALL_PATH
...
checking for main in -lboost_date_time-gcc-mt... no
checking for main in -lboost_date_time-mt... no
checking for main in -lboost_date_time... no
configure: error: "Linking against boost::date-time library failed."
找不到。我知道他们在那里,因为我从头开始编译了 boost 1.53。这里可能是什么问题?
提前非常感谢。