Regex build problem using g++ under cygwin
Hi, I've just started trying to use the Regex library with g++ 3.4.4 under cygwin. I am using the boost 1_33_1 libraries that are installed by cygwin's setup program. For some reason that I cannot figure out, building fails for this simple program test-regex.cpp : #include <boost/regex.hpp> using namespace boost; int main() { regex re; re.assign("hey"); } My build command is: g++ -I/usr/include/boost-1_33_1 -lboost_regex-gcc-mt-s test-regex.cpp Compilation is ok, but during linking I get: /cygdrive/d/temp/ccrjdFg7.o:test-regex.cpp:(.text$_ZN5boost11basic_regex IcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE6assignEPKcS7_j[boost:: basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)]+0x22): 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 I cannot figure out how to solve this problem, and would be grateful if anyone can offer any help. Thanks, Darren Moore.
Hi, Darren. Make sure you've built the Boost.Regex library first, using BJam. See <http://www.boost.org/more/getting_started.html>. Cromwell D. Enage __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Hi Cromwell, Thanks for your response. I just re-built Boost.Regex using bjam, and then tried building my simple test program again linking in the freshly built library - same error as before. The undefined reference error is for basic_regex::do_assign which is implemented in /usr/include/boost-1_33_1/boost/regex/v4/basic_regex.hpp. This makes me suspect that this error is caused by something other than linking an incorrect regex library. Any further ideas are much appreciated. Darren.
Hi, Darren.
Make sure you've built the Boost.Regex library first, using BJam. See <http://www.boost.org/more/getting_started.html>.
Cromwell D. Enage
participants (4)
-
Cromwell Enage
-
Darren Moore
-
Darren.Moore@csiro.au
-
John Maddock