Link to home
Start Free TrialLog in
Avatar of swerves
swerves

asked on

issue building boost::regex on win32

I have tried to install the boost libraries as per http://wagjo.com/index.php?id=27

When i try to declare a regex type i run into linker issues.

eg
boost::regex re("abcde");

gives the linker error
  [Linker error] undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'

it has no issue with
boost::regex re();
though

any pointers please.

Also I am developing using dev-cpp on windows.

ASKER CERTIFIED SOLUTION
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of swerves
swerves

ASKER

I "think" i am linking correctly:

the compile log shows

===============================================
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing  make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
g++.exe main.o  -o "assp_log_parser.exe" -L"C:/Dev-Cpp/lib" -L"C:/Boost/boost_1_39_0/lib"  

main.o(.text$_ZN5boost11basic_regexIcNS_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):main.cpp: 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

make.exe: *** [assp_log_parser.exe] Error 1

Execution terminated
=========================================

which i think means i am linking using the directory "C:/Boost/boost_1_39_0/lib".  I was thinking maybe i dont have everything in that directory that should be.
there are 4 files with regex in their name such as libboost_regex-vc90-mt-gd-1_39.lib

which actually looking at it is slightly concerning, are these libraries for the visual c++ compiler and not the dev-cpp one?
 
Avatar of swerves

ASKER

jkr,

i tried the unicode test but that doesnt seem to be it.
It doesnt compile this time, saying "no matching function.." so i think that means that's not it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial