Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-07-19 11:34:02


Ambarish Mitra wrote:
> Hi all,
>
> I have the following code to validate a given url using boost::regex.
> The
> code is failing linking with g++ 3.3.2, but is building with 3.4.5
>
> Any workaround, or pointer to help to build in 3.3.2? I am on boost
> 1.32.
> All the linking errors are related to std strings.
>
> #include <iostream>
> #include <string>
> #include <boost/regex.hpp> // Boost.Regex lib
>
> using namespace std;
>
> int main( )
> {
> std::string url("http://myserver:80/index.html");
> boost::regex re;
>
> try
> {
> boost::regex
> re("(ftp|http|https):\/\/(\w+\.)*(\w*)\/([\w\d]+\/{0,1})+");
> if (!boost::regex_match(url, re))
> {
> throw "Your URL is not formatted correctly!";
> }
> }
> catch (...)
> {
> cerr << "The regexp " << re << " is invalid!" << endl;
> }
> }
>
> g++ regex2_url.cpp /usr/lib/libboost_regex.a
>
> /usr/lib/libboost_regex.a(c_regex_traits.o)(.text+0xab2): In function
> `boost::re_detail::c_traits_base::set_message_catalogue(std::basic_string<ch
> ar, std::char_traits<char>, std::allocator<char> > const&)':
>> undefined reference to `std::basic_string<char,
>> std::char_traits<char>,

Are you using a version of boost compiled with one gcc version and then
trying to link with another different version? That might do it I guess.

John.


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