MacOS下配置nghttp2-asio失败,寻求技术帮助
我在C++项目中引入了nghttp2/asio,已通过b2从源码编译完成Boost 1.89.0版本,但遇到错误提示「Could not find version of library」,根据autoreconf生成的configure脚本,该错误由BOOST_ASIO_LIB导致。
我参考Boost文档尝试了以下编译命令:
b2 --with-system --with-thread --with-date_time --with-regex --with-serialization stage./b2 install --prefix=$BOOST_PATH threading=multi link=static --with-system --with-thread --with-date_time
- 此命令仅生成我需要的相关库。
./b2 link=static threading=multi --build-type=minimal --prefix=$BOOST_PATH install
- 此命令会构建我所需的所有库,生成的文件将存放于$SOME_PATH。
/b2 --with-system --with-thread --with-date_time --with-regex --with-asio --with-serialization --prefix=$BOOST_PATH stage
- 此命令将创建特定库的stage构建。
我查看了autoreconf生成的nghttp2-asio的configure脚本,相关逻辑片段如下:
if test "x$BOOST_ROOT" != "x"; then for libsubdir in $libsubdirs ; do if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi done if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` stage_version_shorten=`expr $stage_version : '\([0-9]*\.[0-9]*\)'` V_CHECK=`expr $stage_version_shorten \>= $_version` if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: We will use a staged boost library from $BOOST_ROOT" >&5 printf "%s\n" "$as_me: We will use a staged boost library from $BOOST_ROOT" >&6;} BOOST_CPPFLAGS="-I$BOOST_ROOT" BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" fi fi fi
我还尝试设置$BOOST_ROOT后运行nghttp2-asio的configure脚本:
./configure --prefix=$PREFIX_PATH --enable-asio-lib --with-boost=$BOOST_PATH
我希望生成可使用的静态库,反复排查configure脚本后仍未找到问题所在,恳请提供帮助。
内容的提问来源于stack exchange,提问作者Supreet Singh

