Boost logo

Boost Users :

Subject: [Boost-users] installing boost getting error "ld: symbol(s) not found for architecture x86_64" on OSX 10.9.2
From: Corentin Hamel (corentin_at_[hidden])
Date: 2014-04-01 02:21:33


Hi everyone,

I hope this is the right place to ask my question.

I'm trying to build boost 1.55.0 for python on OSX 10.9.2 but i'm encountering the following error "ld: symbol(s) not found for architecture x86_64" and I'm really blocked. I read it might be related to the standard c++ library which changed with maverick to be libc++ by default. But even adding

cxxflags="-stdlib=libstdc++" when executing ./b2 didn't help.

Here is what I did following the boost tutorial:

download boost_1_55_0.tar

./bootstrap.sh --with-libraries=python toolset=darwin

./b2 include="/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/"

And I get the following error:

link.jam: No such file or directory
Building the Boost C++ Libraries.

error: No best alternative for /python_for_extensions
next alternative: required properties: <python>2.7 <target-os>darwin
matched
next alternative: required properties: <python>2.7 <target-os>darwin
matched
error: No best alternative for /python_for_extensions
next alternative: required properties: <python>2.7 <target-os>darwin
matched
next alternative: required properties: <python>2.7 <target-os>darwin
matched

Component configuration:

- python : building

darwin.link.dll bin.v2/libs/python/build/darwin-4.2.1/release/threading- multi/libboost_python.dylib
Undefined symbols for architecture x86_64:
"_PyFile_FromString", referenced from:
boost::python::exec_file(boost::python::str, boost::python::api::object, boost::python::api::object) in exec.o
"_PyFile_AsFile", referenced from:
boost::python::exec_file(boost::python::str, boost::python::api::object, boost::python::api::object) in exec.o
"_PyEval_GetGlobals", referenced from:
boost::python::eval(boost::python::str, boost::python::api::object, boost::python::api::object) in exec.o
boost::python::exec(boost::python::str, boost::python::api::object, boost::python::api::object) in exec.o
boost::python::exec_statement(boost::python::str, boost::python::api::object, boost::python::api::object) in exec.o
boost::python::exec_file(boost::python::str, boost::python::api::object, boost::python::api::object) in exec.o
"_PyRun_StringFlags", referenced from:

........

"_PyExc_StopIteration", referenced from:
boost::python::objects::stop_iteration_error() in iterator.o
"_PyNumber_InPlaceAdd", referenced from:
boost::python::api::operator+=(boost::python::api::object&, boost::python::api::object const&) in object_operators.o
"_PyUnicodeUCS2_FromEncodedObject", referenced from:
_encode_string_unaryfunc in builtin_converters.o
"_PyErr_NoMemory", referenced from:
boost::python::handle_exception_impl(boost::function0<void>) in errors.o
"_PyDict_New", referenced from:
boost::python::detail::dict_base::dict_base() in dict.o
boost::python::detail::dict_base::dict_base() in dict.o
_instance_get_dict in class.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

"g++" -dynamiclib -Wl,-single_module -install_name "libboost_python.dylib" -o "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/libboost_python.dylib" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/numeric.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/list.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/long.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/dict.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/tuple.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/str.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/slice.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/converter/from_python.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/converter/registry.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/converter/type_id.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/enum.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/class.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/function.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/inheritance.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/life_support.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/pickle_support.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/errors.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/module.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/converter/builtin_converters.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/converter/arg_to_python_base.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/iterator.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/stl_iterator.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object_protocol.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object_operators.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/wrapper.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/import.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/exec.o" "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/object/function_doc_signature.o" -headerpad_max_install_names -Wl,-dead_strip -no_dead_strip_inits_and_terms

...failed darwin.link.dll bin.v2/libs/python/build/darwin-4.2.1/release/threading- multi/libboost_python.dylib...
...skipped <pstage/lib>libboost_python.dylib for lack of <pbin.v2/libs/python/build/darwin- 4.2.1/release/threading-multi>libboost_python.dylib...
...failed updating 1 target...
...skipped 1 target...

Thanks for your help!

Corentin Hamel
Software Engineer

Rocketboots
Level 11, 189 Kent Street
Sydney NSW 2000



rb_logo.png

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