Changes between Initial Version and Version 2 of Ticket #42233


Ignore:
Timestamp:
Jan 24, 2014, 6:29:48 AM (10 years ago)
Author:
larryv (Lawrence Velázquez)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #42233

    • Property Keywords python removed
  • Ticket #42233 – Description

    initial v2  
    66
    77I tried to compile this program with c++11 or without c++11:
    8 
    9     #include <boost/python.hpp>
    10     class A {};
    11     BOOST_PYTHON_MODULE(libblah) {
    12       boost::python::class_<A>("A");
    13     }
     8{{{
     9#include <boost/python.hpp>
     10class A {};
     11BOOST_PYTHON_MODULE(libblah) {
     12    boost::python::class_<A>("A");
     13}
     14}}}
    1415
    1516I used cmake, but the build commands generated are below along with the linker error that I get:
     17{{{
     18[100%] Building CXX object CMakeFiles/a.dir/a.cc.o
     19g++   -Da_EXPORTS -std=gnu++0x -save-temps=obj -arch x86_64 -fPIC -I/Users/neil/nn/src -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/Library/Frameworks/Python.framework/Headers -F/usr/local/Qt-5.2.0/lib -I/usr/local/Qt-5.2.0/lib/QtCore.framework/Headers -I/usr/local/Qt-5.2.0/mkspecs/macx-clang -I/usr/local/Qt-5.2.0/lib/QtGui.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers -I/usr/local/Qt-5.2.0/lib/QtOpenGL.framework/Headers -I/usr/local/Qt-5.2.0/lib/QtWidgets.framework/Headers -I/opt/local/Library/Frameworks/Python.framework/Versions/3.3/include/python3.3m -I/Users/neil/nn/src/.    -o CMakeFiles/a.dir/a.cc.o -c /Users/neil/nn/src/a.cc
     20Linking CXX shared module liba.so
     21g++   -std=gnu++0x -save-temps=obj -arch x86_64 -bundle -Wl,-headerpad_max_install_names   -o liba.so CMakeFiles/a.dir/a.cc.o  -L/opt/local/lib  -L/Users/neil/nn/src /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib /opt/local/lib/libboost_python-mt.dylib -Wl,-rpath,/opt/local/lib -Wl,-rpath,/Users/neil/nn/src
     22Undefined symbols for architecture x86_64:
     23  "boost::python::objects::function_object(boost::python::objects::py_function const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&)", referenced from:
     24      boost::python::api::object boost::python::detail::make_function_aux<void (*)(_object*), boost::python::default_call_policies, boost::mpl::vector2<void, _object*>, mpl_::int_<0> >(void (*)(_object*), boost::python::default_call_policies const&, boost::mpl::vector2<void, _object*> const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&, mpl_::int_<0>) in a.cc.o
     25  "boost::python::objects::register_dynamic_id_aux(boost::python::type_info, std::pair<void*, boost::python::type_info> (*)(void*))", referenced from:
     26      void boost::python::objects::register_dynamic_id<A>(A*) in a.cc.o
     27ld: symbol(s) not found for architecture x86_64
     28}}}
    1629
    17     [100%] Building CXX object CMakeFiles/a.dir/a.cc.o
    18     g++   -Da_EXPORTS -std=gnu++0x -save-temps=obj -arch x86_64 -fPIC -I/Users/neil/nn/src -I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/Library/Frameworks/Python.framework/Headers -F/usr/local/Qt-5.2.0/lib -I/usr/local/Qt-5.2.0/lib/QtCore.framework/Headers -I/usr/local/Qt-5.2.0/mkspecs/macx-clang -I/usr/local/Qt-5.2.0/lib/QtGui.framework/Headers -I/System/Library/Frameworks/OpenGL.framework/Headers -I/usr/local/Qt-5.2.0/lib/QtOpenGL.framework/Headers -I/usr/local/Qt-5.2.0/lib/QtWidgets.framework/Headers -I/opt/local/Library/Frameworks/Python.framework/Versions/3.3/include/python3.3m -I/Users/neil/nn/src/.    -o CMakeFiles/a.dir/a.cc.o -c /Users/neil/nn/src/a.cc
    19     Linking CXX shared module liba.so
    20     g++   -std=gnu++0x -save-temps=obj -arch x86_64 -bundle -Wl,-headerpad_max_install_names   -o liba.so CMakeFiles/a.dir/a.cc.o  -L/opt/local/lib  -L/Users/neil/nn/src /opt/local/Library/Frameworks/Python.framework/Versions/3.3/lib/libpython3.3.dylib /opt/local/lib/libboost_python-mt.dylib -Wl,-rpath,/opt/local/lib -Wl,-rpath,/Users/neil/nn/src
    21     Undefined symbols for architecture x86_64:
    22       "boost::python::objects::function_object(boost::python::objects::py_function const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&)", referenced from:
    23           boost::python::api::object boost::python::detail::make_function_aux<void (*)(_object*), boost::python::default_call_policies, boost::mpl::vector2<void, _object*>, mpl_::int_<0> >(void (*)(_object*), boost::python::default_call_policies const&, boost::mpl::vector2<void, _object*> const&, std::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&, mpl_::int_<0>) in a.cc.o
    24       "boost::python::objects::register_dynamic_id_aux(boost::python::type_info, std::pair<void*, boost::python::type_info> (*)(void*))", referenced from:
    25           void boost::python::objects::register_dynamic_id<A>(A*) in a.cc.o
    26     ld: symbol(s) not found for architecture x86_64
    27 
    28 How can I work around this bug without installing boost by myself.  As with this [Related question][1], the symbols in the library
    29 
    30     nm  libboost_python-mt.dylib | c++filt | grep boost::python::objects::function_object
    31 
     30How can I work around this bug without installing boost by myself.  As with this [http://stackoverflow.com/questions/20134223/building-a-boost-python-application-on-macos-10-9-mavericks/20135600#comment32086701_20135600 related question], the symbols in the library
     31{{{
     32nm  libboost_python-mt.dylib | c++filt | grep boost::python::objects::function_object
     33}}}
    3234are found:
    33 
    34     0000000000013d60 T boost::python::objects::function_object(boost::python::objects::py_function const&)
    35     0000000000013d00 T boost::python::objects::function_object(boost::python::objects::py_function const&, std::__1::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&)
     35{{{
     360000000000013d60 T boost::python::objects::function_object(boost::python::objects::py_function const&)
     370000000000013d00 T boost::python::objects::function_object(boost::python::objects::py_function const&, std::__1::pair<boost::python::detail::keyword const*, boost::python::detail::keyword const*> const&)
     38}}}
    3639
    3740However, they have std::__1 prefixes, which do not match what is expected in the undefined symbols errors.
    38 
    39 
    40   [1]: http://stackoverflow.com/questions/20134223/building-a-boost-python-application-on-macos-10-9-mavericks/20135600#comment32086701_20135600