Boost logo

Boost Users :

From: Manish Mangal (Manish.Mangal_at_[hidden])
Date: 2007-01-25 17:13:03


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_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlpd_st
d@@U?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@re_detail_at_boos
t@@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_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlpd_std@@DU?$
regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@boost@@YA_NPBD0AAV?$
match_results_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlpd_std@@@0_at_ABV
?$basic_regex_at_DU?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@0@
W4_match_flags_at_regex_constants_at_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_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlpd_std@@U
?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@re_detail_at_boost@@Q
AE_at_PBD0AAV?$match_results_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlpd
_std@@@2_at_ABV?$basic_regex_at_DU?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@
@@boost@@@2_at_W4_match_flags_at_regex_constants_at_2@0_at_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_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlpd_std@@DU?$
regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@boost@@YA_NPBD0AAV?$
match_results_at_PBDV?$allocator_at_U?$sub_match_at_PBD@boost@@@stlpd_std@@@0_at_ABV
?$basic_regex_at_DU?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@0@
W4_match_flags_at_regex_constants_at_0@@Z)

 

Any help is appreciated

 

Manish Mangal

 Software Engineer

atlas(r) search
Partner for Results

206-816-8349 // phone

Manish.Mangal_at_[hidden] <mailto:t-Matt.Koch_at_[hidden]>
// email
www.AtlasSolutions.com
<outbind://116-000000001368D4B5F8F6D0488191444C76FD7C9507008921F4CB773B0
545AAED425DEF553BC300003A3500100000DB0C51F64BED3447AA6EC585072C4EC300000
1E3B7A70000/jenniferh/Local%20Settings/Temporary%20Internet%20Files/OLK3
/www.AtlasSolutions.com> // web

 



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net