I'm trying to copile an example of how to create a module callable from python3.7.
I think i have done all the steps correctly but when compiling the project i'm getting
a lot of unresolved symbol errors (lnk2019).
The sources are very simple:
#include <iostream>
#define BOOST_PYTHON_STATIC_LIB
#include <boost\python.hpp>
using namespace boost::python;
void sayHello()
{
std::cout << "Hello, Python!\n";
}
BOOST_PYTHON_MODULE(mantid)
{
boost::python::def("sayHello", &sayHello);
}
I think I have configured all the directories correctly
I have compiled using this .bat file
call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" x86
call bootstrap.bat
rem Most libraries can be static libs
b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 --with-python install
[edit]
precisely 7 unresolved symbols (sorry for the ugly format deriving from copy and paste):
unresolved external symbol "class boost::python::api::object __cdecl boost::python::objects::function_object(struct boost::python::objects::py_function const &)" (?function_object@objects@python@boost@@YA?AVobject@api@23@AEBUpy_function@123@@Z) BoostPython C:\work\VC++ Projects\BoostPython\BoostPython\main.obj 1 Build
unresolved external symbol "public: struct _typeobject const * __cdecl boost::python::converter::registration::expected_from_python_type(void)const " (?expected_from_python_type@registration@converter@python@boost@@QEBAPEBU_typeobject@@XZ) BoostPython C:\work\VC++ Projects\BoostPython\BoostPython\main.obj 1 Build
unresolved external symbol "public: virtual unsigned int __cdecl boost::python::objects::py_function_impl_base::max_arity(void)const " (?max_arity@py_function_impl_base@objects@python@boost@@UEBAIXZ) BoostPython C:\work\VC++ Projects\BoostPython\BoostPython\main.obj 1 Build
unresolved external symbol "public: virtual __cdecl boost::python::objects::py_function_impl_base::~py_function_impl_base(void)" (??1py_function_impl_base@objects@python@boost@@UEAA@XZ) BoostPython C:\work\VC++ Projects\BoostPython\BoostPython\main.obj 1 Build
unresolved external symbol "struct boost::python::converter::registration const * __cdecl boost::python::converter::registry::query(struct boost::python::type_info)" (?query@registry@converter@python@boost@@YAPEBUregistration@234@Utype_info@34@@Z) BoostPython C:\work\VC++ Projects\BoostPython\BoostPython\main.obj 1 Build
unresolved external symbol "struct _object * __cdecl boost::python::detail::init_module(struct PyModuleDef &,void (__cdecl*)(void))" (?init_module@detail@python@boost@@YAPEAU_object@@AEAUPyModuleDef@@P6AXXZ@Z) BoostPython C:\work\VC++ Projects\BoostPython\BoostPython\main.obj 1 Build
unresolved external symbol "void __cdecl boost::python::detail::scope_setattr_doc(char const *,class boost::python::api::object const &,char const *)" (?scope_setattr_doc@detail@python@boost@@YAXPEBDAEBVobject@api@23@0@Z) BoostPython C:\work\VC++ Projects\BoostPython\BoostPython\main.obj 1 Build
[/edit]
What I have tried:
I tried everything but i really can't compile the project.
What I am missing?