1

我尝试使用以下命令构建 boost:

#!/bin/bash

if [ -z "$BUILD_PATH" ]
then
    echo "Variable BUILD_PATH isn't specified!"
    exit
fi

BOOST_BUILD_PATH="$BUILD_PATH/boost"
mkdir "$BOOST_BUILD_PATH"

NBITS=64
STAGEDIR="$BOOST_BUILD_PATH"
PLATF_AUX="architecture=x86 address-model=64"
NUMBER_OF_PROCESSORS=$(nproc)
SPEZ_DEFS="-D_GLIBCXX_DEBUG"



./bootstrap.sh
./b2 -j$NUMBER_OF_PROCESSORS --toolset=gcc cxxflags=-std=c++14,-D_GLIBCXX_DEBUG cflags=-D_GLIBCXX_DEBUG variant=release,debug link=shared runtime-link=shared threading=multi \
            --with-locale -s ICU_PATH=$BUILD_PATH/icu \
            --with-system --with-atomic --with-timer --with-thread --with-chrono --with-program_options --with-filesystem --with-date_time --with-regex --with-iostreams \
            -s NO_ZLIB=0 -s ZLIB_INCLUDE=../BUILD/zlib/include -s ZLIB_LIBPATH=$BUILD_PATH/zlib/lib -s NO_BZIP2=1 \
            --stagedir=$STAGEDIR debug-symbols=on $PLATF_AUX --layout=tagged stage

我不知道如何彻底检查 boost 是否使用正确的标志编译。显然,它不是,因为我从构建依赖于 boost 的库中得到这样的错误:

In function `boost::program_options::basic_command_line_parser<char>::basic_command_line_parser(int, char const* const*)':
/path/to/project/../../shared/boost/boost/program_options/detail/parsers.hpp:44: undefined reference to `boost::program_options::detail::cmdline::cmdline(std::__debug::vector<std::string, std::allocator<std::string> > const&)'

但是herehere提到可以使用调试libstdc++编译boost。但是怎么做?

4

0 回答 0