Newbie Question: Boost Regex

Hi, I have a newbie question here. I'm trying to use the Boost regex in
an application, but I keep getting strange errors. How can I compile the
regex code into a DLL or LIB that I can link to from my app -- I'm looking
for the path of least resistance here. The version is 1.33.1, the
platform is VC++ 7.1. The most recent error is the following:
xp_regex_match error LNK2019: unresolved external symbol "private: class
boost::basic_regex
,struct boost::regex_traits
::find(void)" (?find@?$perl_matcher@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@U?$sub_match@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@boost@@@3@U?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@re_detail@boost@@QAE_NXZ) referenced in function "bool __cdecl boost::regex_search ::const_iterator,class std::allocator ::const_iterator> ,char,struct boost::regex_traits (class std::basic_string
::const_iterator,class std::basic_string ::const_iterator,class boost::match_results ::const_iterator,class std::allocator ::const_iterator> > > &,class boost::basic_regex > const &,enum boost::regex_constants::_match_flags,class std::basic_string ::const_iterator)" (??$regex_search@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@U?$sub_match@Vconst_iterator@?$basic_string@DU?$char_t xp_regex_match error LNK2019: unresolved external symbol "public: __thiscall boost::re_detail::perl_matcher ::const_iterator,class std::allocator ::const_iterator> ,struct boost::regex_traits ::perl_matcher ::const_iterator,class std::allocator ::const_iterator> ,struct boost::regex_traits (class std::basic_string ::const_iterator,class std::basic_string ::const_iterator,class boost::match_results ::const_iterator,class std::allocator ::const_iterator> > > &,class boost::basic_regex > const &,enum boost::regex_constants::_match_flags,class std::basic_string ::const_iterator)" (??0?$perl_matcher@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@U?$sub_match@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@boost@@@3@U?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@re_detail@boost@@QAE@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0AAV?$match_results@Vconst_iterator@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@U?$sub_match@Vconst_iterator@?$basic_string@DU?$ xp_regex_match fatal error LNK1120: 3 unresolved externals
Any feedback is appreciated. Thanks!

Hi, I have a newbie question here. I'm trying to use the Boost regex in an application, but I keep getting strange errors. How can I compile the regex code into a DLL or LIB that I can link to from my app -- I'm looking for the path of least resistance here. The version is 1.33.1, the platform is VC++ 7.1. The most recent error is the following:
I don't really see how you can get that, some questions: 1) Did you build with bjam? 2) Are you letting the regex auto-linking code pick the right lib file for you? If not why not? This is a common cause of link time errors otherwise. 3) Are you defining any of the regex optional configuration defines in the lib build, but not in your application? Or vice versa? The lib and your app must be built with *exactly* the same build options. Finally: if you are doing something, umm, strange, and you can't track down the cause of the error, you can always just add the regex source directly to your application. It's just a bunch of sources after all... one caveat though: your app will likely be larger than it needs to be if you do this, unless you prune the sources down to a minimal set. John.

Hi John, thanks for the feedback. I think I resolved the issue. I originally built with bjam, but couldn't seem to get it working. Then I tried doing as you suggested - adding the sources directly to my project - and it still didn't work. I ended up wiping out the Boost dir on my machine, re-downloaded, ran bjam again, and now everything seems to work fine. Apparently I screwed something up on the original build... not sure what, but thanks again for the help! Mike C
Hi, I have a newbie question here. I'm trying to use the Boost regex in an application, but I keep getting strange errors. How can I compile the regex code into a DLL or LIB that I can link to from my app -- I'm looking for the path of least resistance here. The version is 1.33.1, the platform is VC++ 7.1. The most recent error is the following:
I don't really see how you can get that, some questions:
1) Did you build with bjam? 2) Are you letting the regex auto-linking code pick the right lib file for you? If not why not? This is a common cause of link time errors otherwise. 3) Are you defining any of the regex optional configuration defines in the lib build, but not in your application? Or vice versa? The lib and your app must be built with *exactly* the same build options.
Finally: if you are doing something, umm, strange, and you can't track down the cause of the error, you can always just add the regex source directly to your application. It's just a bunch of sources after all... one caveat though: your app will likely be larger than it needs to be if you do this, unless you prune the sources down to a minimal set.
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

I just did this: bjam "-sBUILD=debug <runtime-link>dynamic <threading>multi" "-sTOOLS=vc-7_1" -with-regex --without-python stage Don't forget to call vcvars.bat before starting bjam. Christian
participants (3)
-
admin@geocodenet.com
-
Christian Henning
-
John Maddock