Hi

I have a sample code just to check if I can link to boost regex

The code is :

 

#include <boost/regex.hpp>

 

bool testregex( const char* StringToMatch )

{

        return( boost::regex_match( StringToMatch, boost::regex("[A-Z]+") ));

}

 

int main (int argc, char *argv[])

            {

                  bool trial = testregex( "hello how r u ?");

                  return 1;

            }

 

I am in dll mode both in debug and release versions.

 

The release version compiles, links and runs successfully

 

The debug build, however throws two linker errors:

 

I error LNK2019: unresolved external symbol "public: bool __thiscall boost::re_detail::perl_matcher<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::match(void)" (?match@?$perl_matcher@PBDV?$allocator@U?$sub_match@PBD@boost@@@stlpd_std@@U?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@re_detail@boost@@QAE_NXZ) referenced in function "bool __cdecl boost::regex_match<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> >,char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >(char const *,char const *,class boost::match_results<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> > > &,class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::_match_flags)" (??$regex_match@PBDV?$allocator@U?$sub_match@PBD@boost@@@stlpd_std@@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@boost@@YA_NPBD0AAV?$match_results@PBDV?$allocator@U?$sub_match@PBD@boost@@@stlpd_std@@@0@ABV?$basic_regex@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@0@W4_match_flags@regex_constants@0@@Z)

1>Main.obj : error LNK2019: unresolved external symbol "public: __thiscall boost::re_detail::perl_matcher<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >::perl_matcher<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> >,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >(char const *,char const *,class boost::match_results<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> > > &,class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::_match_flags,char const *)" (??0?$perl_matcher@PBDV?$allocator@U?$sub_match@PBD@boost@@@stlpd_std@@U?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@re_detail@boost@@QAE@PBD0AAV?$match_results@PBDV?$allocator@U?$sub_match@PBD@boost@@@stlpd_std@@@2@ABV?$basic_regex@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@2@W4_match_flags@regex_constants@2@0@Z) referenced in function "bool __cdecl boost::regex_match<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> >,char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > >(char const *,char const *,class boost::match_results<char const *,class stlpd_std::allocator<struct boost::sub_match<char const *> > > &,class boost::basic_regex<char,struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::_match_flags)" (??$regex_match@PBDV?$allocator@U?$sub_match@PBD@boost@@@stlpd_std@@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@boost@@YA_NPBD0AAV?$match_results@PBDV?$allocator@U?$sub_match@PBD@boost@@@stlpd_std@@@0@ABV?$basic_regex@DU?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@0@W4_match_flags@regex_constants@0@@Z)

 

Any help is appreciated

 

Manish Mangal

 Software Engineer


atlas® search
Partner for Results

206-816-8349 // phone

Manish.Mangal@AtlasSolutions.com
 // email
www.AtlasSolutions.com // web