如何使用linux上的调试libstdc ++构建boost(GLIBCXX_DEBUG标志)

时间:2017-07-17 14:12:10

标签: c++ boost g++ b2

我尝试使用以下命令构建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提到可以使用debug libstdc ++编译boost。但是如何?

0 个答案:

没有答案