7

他の Boost プログラムを実行 (コンパイル/リンク) できますが、Boost Regex のリンクに問題があります。

これは「十分に文書化されている」ことを認識していますが、さまざまな投稿がさまざまなバージョンのBoost、さまざまなコンパイラー、bjam (私はb2を使用) を使用しており、私がすでに試したことを示唆しているように見えるため、答えを見つけることができません。

セットアップ

  • Visual Studio 10 (私は C++ を使用しています)

  • ブースト バージョン: 1.53.0

  • 初期インストール: Visual Studio 2010 で Boost を使用する方法に従いました (2 番目のポイント 4 まで行きました)。Unicode サポートが必要な場合にのみ必要だと思うので、正規表現の ICU サポートをダウンロードしていませんか?

  • 「インクルード ディレクトリ」を更新し、C:.......\Boost\boost_1_53_0 を追加して、関連するライブラリをプロジェクト プロパティに含めました。

  • 「C:.....\Boost\boost_1_53_0\stage\lib」を追加して、プロジェクト プロパティ ライブラリ ディレクトリに関連するディレクトリを含め、ライブラリのリンク元を認識できるようにしました (少なくとも、それは私が考えていることです)。これはそうです)。

問題

(たとえば)ブースト乱数を使用して、プログラムをコンパイル、リンク、および実行できます。

次のように言って正規表現機能を追加しようとした場合:

boost::algorithm::split_regex( result, str, regex( "[0-9]+|->" ) )

次の形式のリンク エラーが発生します。

1>Bibtex.obj : error LNK2001: unresolved external symbol "private: class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > & __thiscall boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::do_assign(char const *,char const *,unsigned int)" (?do_assign@?$basic_regex@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@boost@@AAEAAV12@PBD0I@Z)
1>Bibtex.obj : error LNK2001: unresolved external symbol "public: bool __thiscall boost::re_detail::perl_matcher<class std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<struct boost::sub_match<class std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::find(void)" (?find@?$perl_matcher@V?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@U?$sub_match@V?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@boost@@@2@U?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@re_detail@boost@@QAE_NXZ)
1>Bibtex.obj : error LNK2001: unresolved external symbol "private: void __thiscall boost::re_detail::perl_matcher<class std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<struct boost::sub_match<class std::_String_const_iterator<char,struct std::char_traits<char>,class std::allocator<char> > > >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::construct_init(class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::_match_flags)" (?construct_init@?$perl_matcher@V?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@U?$sub_match@V?$_String_const_iterator@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@boost@@@2@U?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@re_detail@boost@@AAEXABV?$basic_regex@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@3@W4_match_flags@regex_constants@3@@Z)
1>C:\Users\kzzgrk\Dropbox\Projects\classes\Bibtex\BibtexFramework\Debug\BibtexFramework.exe : fatal error LNK1120: 3 unresolved externals

私はすべてを試したように見えるので、これを解決する方法がわかりません。私が考えることができる唯一の可能性は、b2コマンドラインプログラムを使用してブーストライブラリを構築する必要があるということですが、そのコマンドが何であるべきかを見つけることができません (上で述べたように、多くの参照は bjam です)。

どんな助け/提案も大歓迎です。

4

2 に答える 2