gpt4 book ai didi

c++ - 使用 configure.ac 找不到 boost c++

转载 作者:行者123 更新时间:2023-11-30 03:06:59 26 4
gpt4 key购买 nike

我写了一个configure.ac来寻找boost c++ inlclude的路径,但是找不到任何东西。如果我指定路径,它可以编译。有人可以帮我吗?这是我的 configure.ac

AC_PREREQ([2.67])
AC_INIT(pkg, 1.1.01)
AC_PROG_CXX

AC_ARG_WITH(
[boost],
[AS_HELP_STRING(
[--with-boost=DIR],
[path to look for Boost])
],
[boostpath=$withval],
[boostpath=]
)

if test -n "$boostpath"; then
boostinc="-I$boostpath/include"
fi

CXXFLAGS="$CXXFLAGS ${boostinc}"

AC_SUBST([CXXFLAGS])

AC_CONFIG_FILES([Makevars])
AC_OUTPUT

非常感谢。

最佳答案

只需使用 AX_BOOST_BASE来自 autoconf-archive .

如果您尝试AC_CHECK_HEADERS 来验证 boost header 的存在,请记住您需要先AC_LANG_PUSH([C++]),否则您将获得“ header 存在但无法编译”错误。

关于c++ - 使用 configure.ac 找不到 boost c++,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6113006/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com