TNG / boost-python-examples

Some examples for the use of boost::python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error Building on Mac OS X Sierra 10.13.3

dendisuhubdy opened this issue · comments

grokmachine@spock  ~/dev/boost-python-examples   master  ./build.sh
++ basename ./build.sh
+ cd ./
+ mkdir build
mkdir: build: File exists
+ cd build
+ [[ darwin17 == \l\i\n\u\x\-\g\n\u ]]
+ [[ darwin17 == \l\i\n\u\x ]]
+ [[ darwin17 == \d\a\r\w\i\n* ]]
++ python -c 'import sys;t='\''{v[0]}.{v[1]}'\''.format(v=list(sys.version_info[:2]));sys.stdout.write(t)'
+ PYTHON_VERSION=2.7
+ PYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
+ PYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/2.7/Headers/
+ cmake -DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib -DPYTHON_INCLUDE_DIR=/usr/local/Frameworks/Python.framework/Versions/2.7/Headers/ -DCMAKE_BUILD_TYPE=DEBUG ..
-- Could NOT find Boost
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/grokmachine/dev/boost-python-examples/build
+ make
Scanning dependencies of target hello
[  3%] Building CXX object 01-HelloWorld/CMakeFiles/hello.dir/hello.cpp.o
[  6%] Linking CXX shared module hello.so
Undefined symbols for architecture x86_64:
  "boost::python::detail::init_module(char const*, void (*)())", referenced from:
      _inithello in hello.cpp.o
  "boost::python::detail::gcc_demangle(char const*)", referenced from:
      boost::python::type_info::name() const in hello.cpp.o
  "boost::python::detail::scope_setattr_doc(char const*, boost::python::api::object const&, char const*)", referenced from:
      void boost::python::def<char const* (*)()>(char const*, char const* (*)()) in hello.cpp.o
  "boost::python::objects::function_object(boost::python::objects::py_function const&)", referenced from:
      boost::python::api::object boost::python::detail::make_function_aux<char const* (*)(), boost::python::default_call_policies, boost::mpl::vector1<char const*> >(char const* (*)(), boost::python::default_call_policies const&, boost::mpl::vector1<char const*> const&) in hello.cpp.o
  "boost::python::objects::py_function_impl_base::~py_function_impl_base()", referenced from:
      boost::python::objects::caller_py_function_impl<boost::python::detail::caller<char const* (*)(), boost::python::default_call_policies, boost::mpl::vector1<char const*> > >::~caller_py_function_impl() in hello.cpp.o
  "boost::python::converter::do_return_to_python(char const*)", referenced from:
      boost::python::to_python_value<char const* const&>::operator()(char const* const&) const in hello.cpp.o
  "boost::python::converter::registry::query(boost::python::type_info)", referenced from:
      boost::python::converter::expected_pytype_for_arg<char const*>::get_pytype() in hello.cpp.o
  "boost::python::objects::py_function_impl_base::max_arity() const", referenced from:
      vtable for boost::python::objects::caller_py_function_impl<boost::python::detail::caller<char const* (*)(), boost::python::default_call_policies, boost::mpl::vector1<char const*> > > in hello.cpp.o
  "boost::python::converter::registration::expected_from_python_type() const", referenced from:
      boost::python::converter::expected_pytype_for_arg<char const*>::get_pytype() in hello.cpp.o
  "typeinfo for boost::python::objects::py_function_impl_base", referenced from:
      typeinfo for boost::python::objects::caller_py_function_impl<boost::python::detail::caller<char const* (*)(), boost::python::default_call_policies, boost::mpl::vector1<char const*> > > in hello.cpp.o
  "vtable for boost::python::objects::py_function_impl_base", referenced from:
      boost::python::objects::py_function_impl_base::py_function_impl_base() in hello.cpp.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [01-HelloWorld/hello.so] Error 1
make[1]: *** [01-HelloWorld/CMakeFiles/hello.dir/all] Error 2
make: *** [all] Error 2

#20 does not fix the Boost identification problem for me, so I keep the issue open for now.