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 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 const&)':
: undefined reference to `std::basic_string::_Rep::_S_empty_rep_storage'
/usr/lib/libboost_regex.a(c_regex_traits.o)(.text+0xac2): In function
`boost::re_detail::c_traits_base::set_message_catalogue(std::basic_string const&)':
: undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
/usr/lib/libboost_regex.a(c_regex_traits.o)(.text+0xaf6): In function
`boost::re_detail::c_traits_base::set_message_catalogue(std::basic_string const&)':
: undefined reference to `std::basic_string::_Rep::_S_empty_rep_storage'
/usr/lib/libboost_regex.a(c_regex_traits.o)(.text+0xb0f): In function
`boost::re_detail::c_traits_base::set_message_catalogue(std::basic_string const&)':
: undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
...
...
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Pvt. Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Pvt. Ltd. does not accept any liability for virus infected mails.