Advertisement

01.31.2007 at 08:53AM PST, ID: 22143901
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

linker error with boost regex and g++

Asked by jhshukla in Miscellaneous Programming, C++ Programming Language, Regular Expressions

Tags: , ,

I have the following makefile:
CC := g++

MACHINE_OPTS := -mtune=athlon64

INCLUDE_PATH := /home/jaydutt/boost_1_33_1
LIB_PATH := /home/jaydutt/boost_1_33_1/bin/boost/libs/regex/build/libboost_regex.a/gcc/debug

CC_OPTS := $(MACHINE_OPTS) -Wall -Werror

expr: main.o expr.o
      $(CC) $(CC_OPTS) -L$(LIB_PATH) main.o expr.o

main.o: main.cpp expr.h
      $(CC) $(CC_OPTS) -I$(INCLUDE_PATH) -c main.cpp

expr.o: expr.cpp expr.h
      $(CC) $(CC_OPTS) -I$(INCLUDE_PATH) -c expr.cpp

pre: expr.cpp expr.h
      $(CC) $(CC_OPTS) -I$(INCLUDE_PATH) -E expr.cpp

clean:
      rm -f *~ *.o a.out

Boost libraries are built and stored in ~/boost_1_33_1/...

when I try to make expr target, I run into linker error:
expr.o: In function `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)':
expr.cpp:(.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)]+0x27): undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'

I am sure something is wrong with linker options. or the libraries. I tried to find which obj file defined the desired function and it is .../libboost_regex.a/gcc/debug/instances.o. I added the fully qualified path to makefile only to end up with more undefined references.Start Free Trial
 
Keywords: linker error with boost regex and g++
 
Loading Advertisement...
 
[+][-]01.31.2007 at 04:01PM PST, ID: 18440890

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Miscellaneous Programming, C++ Programming Language, Regular Expressions
Tags: boost, regex, reference
Sign Up Now!
Solution Provided By: Infinity08
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32