I am having problems linking Boost Regex, though I can run (compile/link) other Boost Programs.
I realise that this is "well documented" but I cannot find the answer as the various posts use different versions of Boost, different compilers, use bjam (I used b2), seem to suggest what I have already tried etc.
The Setup
Visual Studio 10 (I am using C++)
Boost Version: 1.53.0
Initial Install: I followed How to use Boost in Visual Studio 2010 (I went as far as the second point 4). I have not downloaded the ICU support for Regex as I think this is only required if you need Unicode support?
I have included the relevant library in the Project Properties by updating "Include Directories" and adding C:.......\Boost\boost_1_53_0
I have included the relevant directory in the Project Properties Library Directories by adding "C:.....\Boost\boost_1_53_0\stage\lib" so that it knows where the libraries are to link from (at least that is what I think this does).
The Problem
I can compile, link and run a program using (for example) Boost Random Numbers.
If I tried to add Regex functionality by saying:
boost::algorithm::split_regex( result, str, regex( "[0-9]+|->" ) )
I get linking errors of the following form.
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
I have no idea how to solve this as I seem to have tried everything. The only possibility I can think of is that I need to build the boost libraries using the b2
command line program, but I cannot find out what that commend should be (as I say above a lot of references are to bjam).
Any help/suggestion would be greatly appreciated.