boost:stacktraceのすべての例をコンパイルできます。ここに私のbashスクリプトは次のとおりです。boost :: stacktraceはアドレスを出力します
#!/bin/bash
export CXX=~/x-tools/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++
export BOOST_INCLUDE=$HOME/x-libs/$($CXX -dumpmachine)/include
export BOOST_LIB=$HOME/x-libs/$($CXX -dumpmachine)/lib
export BOOST_SUFFIX="mt-d"
(ls $BOOST_LIB/*$BOOST_SUFFIX.a | tr "\n" "\0" | xargs -0 -n 1 basename | while read A; do B=-l$(echo $A | sed -e 's/^lib//' | sed -e 's/\.a//'); echo $B; done;) | tr "\n" " " > $BOOST_LIB/list_boost.txt
export BOOST_LIBS="cat $BOOST_LIB/list_boost.txt"
export EXECUTABLE_SUFFIX=""
$CXX -w -g3 -o assert_handler-$($CXX -dumpmachine)$EXECUTABLE_SUFFIX assert_handler.cpp -std=c++11 -static -I$BOOST_INCLUDE -L$BOOST_LIB $(eval $BOOST_LIBS) -ldl
$CXX -w -g3 -o debug_function-$($CXX -dumpmachine)$EXECUTABLE_SUFFIX debug_function.cpp -std=c++11 -static -I$BOOST_INCLUDE -L$BOOST_LIB $(eval $BOOST_LIBS) -ldl
$CXX -w -g3 -o terminate_handler-$($CXX -dumpmachine)$EXECUTABLE_SUFFIX terminate_handler.cpp -std=c++11 -static -I$BOOST_INCLUDE -L$BOOST_LIB $(eval $BOOST_LIBS) -ldl -lrt -lpthread
$CXX -w -g3 -o throwing_st-$($CXX -dumpmachine)$EXECUTABLE_SUFFIX throwing_st.cpp -std=c++11 -static -I$BOOST_INCLUDE -L$BOOST_LIB $(eval $BOOST_LIBS) -ldl
$CXX -w -g3 -o trace_addresses-$($CXX -dumpmachine)$EXECUTABLE_SUFFIX trace_addresses.cpp -std=c++11 -static -I$BOOST_INCLUDE -L$BOOST_LIB $(eval $BOOST_LIBS)
$CXX -w -g3 -o user_config-$($CXX -dumpmachine)$EXECUTABLE_SUFFIX user_config.cpp -std=c++11 -static -I$BOOST_INCLUDE -L$BOOST_LIB $(eval $BOOST_LIBS) -ldl
生成ブーストリストは次のようになります。
-lboost_atomic-mt-d -lboost_chrono-mt-d -lboost_container-mt-d -lboost_context-mt-d -lboost_coroutine-mt-d -lboost_date_time-mt-d -lboost_exception-mt-d -lboost_fiber-mt-d -lboost_filesystem-mt-d -lboost_graph-mt-d -lboost_iostreams-mt-d -lboost_locale-mt-d -lboost_log-mt-d -lboost_log_setup-mt-d -lboost_math_c99f-mt-d -lboost_math_c99l-mt-d -lboost_math_c99-mt-d -lboost_math_tr1f-mt-d -lboost_math_tr1l-mt-d -lboost_math_tr1-mt-d -lboost_prg_exec_monitor-mt-d -lboost_program_options-mt-d -lboost_random-mt-d -lboost_regex-mt-d -lboost_serialization-mt-d -lboost_signals-mt-d -lboost_stacktrace_addr2line-mt-d -lboost_stacktrace_basic-mt-d -lboost_stacktrace_noop-mt-d -lboost_system-mt-d -lboost_test_exec_monitor-mt-d -lboost_thread-mt-d -lboost_timer-mt-d -lboost_type_erasure-mt-d -lboost_unit_test_framework-mt-d -lboost_wave-mt-d -lboost_wserialization-mt-d
私は例を実行する場合は、ポインタを出力します。
./assert_handler-x86_64-unknown-linux-gnu
Expression 'i < N' is false in function 'T& boost::array<T, N>::operator[](boost::array<T, N>::size_type) [with T = int; long unsigned int N = 5ul; boost::array<T, N>::reference = int&; boost::array<T, N>::size_type = long unsigned int]': out of range.
Backtrace:
0# 0x00000000004019B2
1# 0x0000000000401B39
2# 0x0000000000400E3B
3# 0x0000000000400E6B
4# 0x0000000000400E44
5# 0x0000000000400E6B
6# 0x0000000000400E7C
7# 0x000000000045BF2B
8# 0x000000000045C1D1
9# 0x0000000000400CEA
は、私が何かを逃したことがありますか?
私はそれを使用していませんが、記号情報を検索するためにboostを教える必要はありませんか? http://www.boost.org/doc/libs/1_65_1/doc/html/stacktrace/configuration_and_build.html –