Boost logo

Boost Users :

From: Vijay Choudhary (VKChoudhary_at_[hidden])
Date: 2006-04-04 00:28:39


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_at_re_detail_at_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> > >
>(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_at_U?$regex_traits_wrapper_at_U?$regex_traits_at_DV?$w32_regex_tr
aits_at_D@boost@@@boost@@@boost@@@re_detail_at_boost@@YAXABU?$regex_traits_wra
pper_at_U?$regex_traits_at_DV?$w32_regex_traits_at_D@boost@@@boost@@@1_at_W4error_ty
pe_at_regex_constants_at_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_at_re_detail_at_boost@@YA?AV?$basic_string_at_DV?$char_traits_at_D@_
STL@@V?$allocator_at_D@2@@_STL@@KPBD0_at_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_at_D@boost@@QBE?AV?$basic_string_at_DV?$char_tr
aits_at_D@_STL@@V?$allocator_at_D@2@@_STL@@PBD0_at_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


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