I created a VST host in C++ and I want to use a python wrapper using boost-python3 in macos with xcode.
I added :
/usr/local/include /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/include/python3.7m/`Preformatted text
to header search path, and:
> /usr/local/Cellar/boost-python3/1.70.0_1/lib > /usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/
to library search path.
When trying to compile I get the linking error:
Undefined symbols for architecture x86_64: "_PyUnicode_Type", referenced from: boost::python::to_python_value<char const* const&>::get_pytype() const in Source.o "__Py_NoneStruct", referenced from: boost::python::api::object::object() in Source.o "boost::python::detail::init_module(PyModuleDef&, void (*)())", referenced from: _PyInit_hello_ext in Source.o "boost::python::detail::gcc_demangle(char const*)", referenced from: boost::python::type_info::name() const in Source.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 Source.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 Source.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 Source.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 Source.o "boost::python::converter::registry::query(boost::python::type_info)", referenced from: boost::python::converter::expected_pytype_for_arg<char const*>::get_pytype() in Source.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 Source.o "boost::python::converter::registration::expected_from_python_type() const", referenced from: boost::python::converter::expected_pytype_for_arg<char const*>::get_pytype() in Source.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 Source.o "vtable for boost::python::objects::py_function_impl_base", referenced from: boost::python::objects::py_function_impl_base::py_function_impl_base() in Source.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)
The linker output is:
Ld build/Debug/Midi2KontaktDLL.dylib normal x86_64 cd /Users/didi/Development/Juce/Midi2KontaktDLL/Builds/MacOSX export MACOSX_DEPLOYMENT_TARGET=10.11 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -L/Users/didi/Development/Juce/Midi2KontaktDLL/Builds/MacOSX/build/Debug -L/usr/local/Cellar/boost-python3/1.70.0_1/lib -L/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib -F/Users/didi/Development/Juce/Midi2KontaktDLL/Builds/MacOSX/build/Debug -filelist /Users/didi/Library/Developer/Xcode/DerivedData/Midi2KontaktDLL-eupsdkbbrcwqymategfreyedipek/Build/Intermediates.noindex/Midi2KontaktDLL.build/Debug/Midi2KontaktDLL\ -\ Dynamic\ Library.build/Objects-normal/x86_64/Midi2KontaktDLL.LinkFileList -install_name /usr/local/lib/Midi2KontaktDLL.dylib -mmacosx-version-min=10.11 -Xlinker -object_path_lto -Xlinker /Users/didi/Library/Developer/Xcode/DerivedData/Midi2KontaktDLL-eupsdkbbrcwqymategfreyedipek/Build/Intermediates.noindex/Midi2KontaktDLL.build/Debug/Midi2KontaktDLL\ -\ Dynamic\ Library.build/Objects-normal/x86_64/Midi2KontaktDLL_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -stdlib=libc++ -framework Accelerate -framework AudioToolbox -framework Carbon -framework Cocoa -framework CoreAudio -framework CoreMIDI -framework IOKit -framework OpenGL -framework QuartzCore -framework WebKit -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/didi/Library/Developer/Xcode/DerivedData/Midi2KontaktDLL-eupsdkbbrcwqymategfreyedipek/Build/Intermediates.noindex/Midi2KontaktDLL.build/Debug/Midi2KontaktDLL\ -\ Dynamic\ Library.build/Objects-normal/x86_64/Midi2KontaktDLL_dependency_info.dat -o /Users/didi/Development/Juce/Midi2KontaktDLL/Builds/MacOSX/build/Debug/Midi2KontaktDLL.dylib
I would appreciate any help!