You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can compile and run all other example except for 05-inheritance on VS 2015 with Boost.Python 2.7 x64, which gave me the following linking error:
1>inheritance.obj : error LNK2019: unresolved external symbol "class Base const volatile * __cdecl boost::get_pointer<class Base const volatile >(class Base const volatile *)" (??$get_pointer@$$CDVBase@@@boost@@YAPEDVBase@@PEDV1@@Z) referenced in function "public: static struct _object * __cdecl boost::python::objects::make_instance_impl<class Base,struct boost::python::objects::pointer_holder<class std::auto_ptr<class Base>,class Base>,struct boost::python::objects::make_ptr_instance<class Base,struct boost::python::objects::pointer_holder<class std::auto_ptr<class Base>,class Base> > >::execute<class std::auto_ptr<class Base> >(class std::auto_ptr<class Base> &)" (??$execute@V?$auto_ptr@VBase@@@std@@@?$make_instance_impl@VBase@@U?$pointer_holder@V?$auto_ptr@VBase@@@std@@VBase@@@objects@python@boost@@U?$make_ptr_instance@VBase@@U?$pointer_holder@V?$auto_ptr@VBase@@@std@@VBase@@@objects@python@boost@@@345@@objects@python@boost@@SAPEAU_object@@AEAV?$auto_ptr@VBase@@@std@@@Z)
Based on this discussion, I was able to fix the problem by adding the following code to inheritance.cpp. Not sure whether this should be counted as a bug of this project, but I guess it might help others if they also found this issue.
I know it's been a couple of months now, but I need to use Boost::python and tried to crack it with a help of Your code. After few days and boost-headaches I can say, that I successfully ran Your code on:
-Win 10 x64
-Python 3.6 x64
-Boost 1.65
-VS Enterprise 2017 v.15.2 (compiler msvc-14.1)
-CMake 3.9.1
build Boost myself, to make it work with my python version (not sure how it works with boost::python for python 2.7).
make change in CMakeLists to look for python (not python3).
make changes in CMake (FindBoost.cmake) to actually recognize Boost 1.65
change linker settings in VS to look for boost_python3*.dll instead of boost_python*.dll one.
move created *.pyd file next to the *.py file for it to work, but that is normal as far as I recall.
Yet all of these problems are related to Boost and CMake, not Your code ;)
build Boost _python need careful, othervise will happen Link error like this: 1>boost_python39-vc142-mt-gd-x64-1_75.lib(pickle_support.obj): error LNK2001: unresolved external symbol __imp__Py_Dealloc
1>boost_python39-vc142-mt-gd-x64-1_75.lib(function.obj) : error LNK2019: unresolved external symbol __imp__Py_NewReference referenced in function _PyObject_INIT
Activity
Achimh3011 commentedon Mar 6, 2017
Do you want to open a PR? I never tried to compile the code on Windows, but it'd be nice to have that platform supported as well.
mkulagowski commentedon Sep 3, 2017
I know it's been a couple of months now, but I need to use Boost::python and tried to crack it with a help of Your code. After few days and boost-headaches I can say, that I successfully ran Your code on:
-Win 10 x64
-Python 3.6 x64
-Boost 1.65
-VS Enterprise 2017 v.15.2 (compiler msvc-14.1)
-CMake 3.9.1
I built all of them, but checked only 1,2,3 & 5.
Achimh3011 commentedon Sep 3, 2017
Hi, was the aforementioned patch included or did it work without?
mkulagowski commentedon Sep 3, 2017
It worked without but I had to:
Yet all of these problems are related to Boost and CMake, not Your code ;)
Achimh3011 commentedon Jun 19, 2018
I close the issue now. I'd still accept an PR if anyone had one...
ruoxu233 commentedon Jan 14, 2023
build Boost _python need careful, othervise will happen Link error like this:
1>boost_python39-vc142-mt-gd-x64-1_75.lib(pickle_support.obj): error LNK2001: unresolved external symbol __imp__Py_Dealloc
1>boost_python39-vc142-mt-gd-x64-1_75.lib(function.obj) : error LNK2019: unresolved external symbol __imp__Py_NewReference referenced in function _PyObject_INIT