0

I have compiled boost library myself using g++4.8 compilation finished with success. Everything is located in ~/bin/boost. After compilation all files are located in /Users/$(USER)/bin/boost/stage/lib/

Below necessary make parts:

CC=g++-4.8 LD=g++-4.8 BOOST_LIB_PATH=/Users/$(USER)/bin/boost/stage/lib/ BOOST_HEADER_PATH=/Users/$(USER)/bin/boost/ LFLAGS=-L$(BOOST_LIB_PATH) -lboost_thread release: $(OBJ) $(LD) $(OBJ) obj/main.o $(LFLAGS) -o $(RELEASE_NAME) 

Everything goes ok during compilation but the linking process fail. Basically all errors look the same:

ndefined symbols for architecture x86_64: "boost::system::system_category()", referenced from: __static_initialization_and_destruction_0(int, int) 

I have already read : Attempting to use Boost.Filesystem however it doesn't seem to link? C++ / Boost: Undefined Symbols in example? and many others but still did not find solution.

I have no idea where is problem, i have change the order of linking, i try to link directly thread library but i still get same result. Problems occur during compilation of https://github.com/dbedla/snake-cpp11 under mac os x 10.8.4 (I have to modify makefile)

I will be grateful for any suggestion how to solve problem.

Sorry for my english :(

2
  • 4
    You need to add -lboost_system to the linker commmand Commented Aug 23, 2013 at 21:57
  • You seem not to have selected an answer for your question. What is missing still? What more can we do for you? Commented Sep 28, 2013 at 5:14

2 Answers 2

5

You also need to add -lboost_system after where you had -lboost_thread.

Sign up to request clarification or add additional context in comments.

Comments

0

Your problem is with the boost system category, so you need to link against that (libboost_system), too.

CC=g++-4.8 LD=g++-4.8 BOOST_LIB_PATH=/Users/$(USER)/bin/boost/stage/lib/ BOOST_HEADER_PATH=/Users/$(USER)/bin/boost/ LFLAGS=-L$(BOOST_LIB_PATH) -lboost_thread -lboost_system release: $(OBJ) $(LD) $(OBJ) obj/main.o $(LFLAGS) -o $(RELEASE_NAME) 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.