
Ubuntu日本語フォーラム

ログインしていません。
boostライブラリを用いてプログラミングしています.
10.04上で以下のコマンドでboostをインストールしました.
$ sudo apt-get install 'libboost*-dev'
9.10までprogram_options.hppをインクルードしてg++オプションでboost_program_options-mtライブラリを指定していましたが,
このオプションではコンパイルできなくなりました.
自分なりに調べてみて,
$ g++ hogehoge.cpp -lboost_program_options-mt-d
としてコンパイルしたところ
olwlb.o: In function `main':
olwlb.cpp:(.text+0x1196): undefined reference to `boost::program_options::options_description::m_default_line_length'
olwlb.o: In function `boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)':
olwlb.cpp:(.text._ZN5boost15program_options25basic_command_line_parserIcE12extra_parserENS_9function1ISt4pairISsSsERKSsEE[boost::program_options::basic_command_line_parser<char>::extra_parser(boost::function1<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)]+0x28): undefined reference to `boost::program_options::detail::cmdline::set_additional_parser(boost::function1<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>)'
collect2: ld returned 1 exit status
make: *** [olwlb] エラー 1
となりました.
cannot findとログが表示されていないことから指定自体は間違ってないみたいなんですが,正常にコンパイルできません.
もうこれ以上自分で出来ることがないので,助けてください.
オフライン
$ ldconfig -p | grep boost_program_options
libboost_program_options.so.1.40.0 (libc6) => /usr/lib/libboost_program_options.so.1.40.0
libboost_program_options-gcc42-mt-d-1_34_1.so.1.34.1 (libc6) => /usr/lib/libboost_program_options-gcc42-mt-d-1_34_1.so.1.34.1
libboost_program_options-gcc42-mt-d-1_34_1.so (libc6) => /usr/lib/libboost_program_options-gcc42-mt-d-1_34_1.so
libboost_program_options-gcc42-d-1_34_1.so.1.34.1 (libc6) => /usr/lib/libboost_program_options-gcc42-d-1_34_1.so.1.34.1
libboost_program_options-gcc42-d-1_34_1.so (libc6) => /usr/lib/libboost_program_options-gcc42-d-1_34_1.so
オフライン
$ sudo ln -s libboost_program_options.so.1.40.0 libboost_program_options.so
としたら,正常にコンパイルできました.
また,実行においてコアダンプしていないので正常に動いてると思います.
オフライン