Linker errors with boost::regex with boost_1_33_1, STLport-4.6.2 and VS7.1

(struct boost::regex_traits_wrapper<struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > const &,enum boost::regex_constants::error_type)" (??$raise_error@U?$regex_traits_wrapper@U?$regex_traits@DV?$w32_regex_tr aits@D@boost@@@boost@@@boost@@@re_detail@boost@@YAXABU?$regex_traits_wra
Hi All, Is there a known issue of linker errors with using boost::regex library with STLport. If I don't install STLport I am able to build regex however I am getting linker error while trying to build after installing STLPort. Operating System:Win-XP IDE: Visual Studio .NET(version 7.1.3088) STLPort version: STLport-4.6.2 Boost versio:boost_1_33_1 The code which I have used in sample project: #include "stdafx.h" #include <boost/regex.hpp> #include <iostream> #include <string> int _tmain(int argc, _TCHAR* argv[]) { std::string line; boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" ); while (std::cin) { std::getline(std::cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) std::cout << matches[2]; } return 0; } I got following linker errors: ConsoleApp1.obj : error LNK2019: unresolved external symbol "void __cdecl boost::re_detail::raise_runtime_error(class _STL::runtime_error const &)" (?raise_runtime_error@re_detail@boost@@YAXABVruntime_error@_STL@@@Z) referenced in function "void __cdecl boost::re_detail::raise_error<struct boost::regex_traits_wrapper<struct boost::regex_traits<char,class boost::w32_regex_traits<char> > > pper@U?$regex_traits@DV?$w32_regex_traits@D@boost@@@boost@@@1@W4error_ty pe@regex_constants@1@@Z) ConsoleApp1.obj : error LNK2019: unresolved external symbol "class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > __cdecl boost::re_detail::w32_transform(unsigned long,char const *,char const *)" (?w32_transform@re_detail@boost@@YA?AV?$basic_string@DV?$char_traits@D@_ STL@@V?$allocator@D@2@@_STL@@KPBD0@Z) referenced in function "public: class _STL::basic_string<char,class _STL::char_traits<char>,class _STL::allocator<char> > __thiscall boost::w32_regex_traits<char>::transform(char const *,char const *)const " (?transform@?$w32_regex_traits@D@boost@@QBE?AV?$basic_string@DV?$char_tr aits@D@_STL@@V?$allocator@D@2@@_STL@@PBD0@Z) Debug/ConsoleApp1.exe : fatal error LNK1120: 2 unresolved externals However if I comment call to function boost::regex_match() in sample code , then I am able to build it. Regards: Vijay Kumar

Is there a known issue of linker errors with using boost::regex library with STLport.
If I don't install STLport I am able to build regex however I am getting linker error while trying to build after installing STLPort.
Vijay, apologies but I haven't had time to look at your project. Have you done as I suggested and just added the regex source files to your project and/or tried building regex as a static lib from the IDE using *exactly* the same settings as your project? There are so many variables with STLport it's pretty much impossible to track down problems like this via email. Basically it's a question of checking that the library build settings match your IDE project *exactly*. Check everything, then check it again, it's the only way. John.
participants (2)
-
John Maddock
-
Vijay Choudhary