Boost logo

Boost Users :

From: canx11 (canx11_at_[hidden])
Date: 2007-11-23 14:13:52


Hello,

i am new to c++ coding and for practicing i want to rewrite some of my old
perl scripts that use regular expressions in c++. So i installed libboost
for regex version 1.34.1 on my workstation (using a kubuntu package).

Unfortunatley even the most simple program i can think of does not want to
compile:

#include <iostream>
#include <cstdlib>
#include <boost/regex.hpp>
using namespace boost;
using namespace std;

int main(int argc, char *argv[])
{
        boost::regex(".*");
        cout << "test\n";
        return 0;
}

...giving me:

[...]
testapp.o: In function `boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned
int)':
/usr/include/boost/regex/v4/basic_regex.hpp:255: undefined reference to
`boost::basic_regex<char, boost::regex_traits<char,
boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*,
unsigned int)'
collect2: ld returned 1 exit status
[...]

Anyhow if i am doing

int main(int argc, char *argv[])
{
        boost::regex();
        cout << "test\n";
        return 0;
}

withouth passing a regex condition it compiles successful...Yes i know this
short programm does not give any meaningful functionality but i just want to
demonstrate that the intialization of the basic_regex fails on my machine.

Do i have problem with my libboost installation or just a simple syntax error
here?

regards

Jan


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