Hello,
I am trying to compile the quickstart example for the boost-python project, but
I can't seem to succeed. I was hoping someone from the mailing list could point
me to the right direction.
I am trying to follow the official documentation
(https://www.boost.org/doc/libs/1_62_0/libs/python/doc/html/building/no_install_quickstart.html
etc) ,but seem to have to do a lot of extra steps, and still without result:
My current approach:
* (On a windows machine, having visual studio community 2017 installed, and
so also the MSVC, as well as python 3.5)
* Download boost_1_68_0 and extract into C:\boost_1_68_0
* Run bootstrap
If I then try to follow the official documentation, the build fails with:
C:\boost_1_68_0\libs\python\example\quickstart>..\..\..\..\.\b2
warning: no Python configured in user-config.jam
warning: will use default configuration
...found 26 targets...
...updating 11 targets...
msvc.write-setup-script ..\bin\standalone\msvc\msvc-14.1\msvc-setup.bat
compile-c-c++ extending.obj
extending.cpp
extending.cpp(5): fatal error C1083: Cannot open include file:
'boost/python/class.hpp': No such file or directory
I figured out that by modifying the higher-level Jamroot file, that by adding
"C:\\boost_1_68_0", I can at least get further.
The next error I run into is:
C:\boost_1_68_0\libs\python\example\quickstart>..\..\..\..\.\b2
warning: no Python configured in user-config.jam
warning: will use default configuration
...patience...
...patience...
...found 1400 targets...
...updating 6 targets...
compile-c-c++ extending.obj
extending.cpp
msvc.link.dll extending.pyd
LINK : fatal error LNK1181: cannot open input file 'boost_python.lib'
I then "guessed" that I needed to manually build this library first, and so I
ran: "C:\boost_1_68_0>.\b2 --with-python -j4". This then builds some libraries,
like "libboost_python35-vc141-mt-gd-x32-1_68.lib".
This still does not fix any build. Only when I manually copy the libraries to
the example folder, and rename them, it finally tries to link, but then gives a
lot of other errors. (See attachment)
I am clearly missing something here in either the build tool (never used jam
before), or in my procedure.
Can somebody perhaps enlighten me with the correct procedure?
Thanks in advance!
Arnout
C:\boost_1_68_0\libs\python\example\quickstart>..\..\..\..\.\b2
warning: no Python configured in user-config.jam
warning: will use default configuration
...patience...
...patience...
...found 1400 targets...
...updating 5 targets...
msvc.link.dll extending.pyd
Creating library extending.lib and object extending.exp
extending.obj : warning LNK4217: locally defined symbol
??0instance_holder@python@boost@@QAE@XZ (public: __thiscall
boost::python::instance_holder::instance_holder(void)) imported in function
"public: __thiscall boost::python::objects::value_holder::value_holder,class std::allocator > > >(struct _object *,struct
boost::python::objects::reference_to_value,class std::allocator > >)"
(??$?0U?$reference_to_value@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@objects@python@boost@@@?$value_holder@Vhello@?A0x58ed8be9@@@objects@python@boost@@QAE@PAU_object@@U?$reference_to_value@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@123@@Z)
extending.obj : warning LNK4217: locally defined symbol
??1instance_holder@python@boost@@UAE@XZ (public: virtual __thiscall
boost::python::instance_holder::~instance_holder(void)) imported in function
__unwindfunclet$??$?0U?$reference_to_value@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@objects@python@boost@@@?$value_holder@Vhello@?A0x58ed8be9@@@objects@python@boost@@QAE@PAU_object@@U?$reference_to_value@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@123@@Z$0
extending.obj : warning LNK4217: locally defined symbol
?install@instance_holder@python@boost@@QAEXPAU_object@@@Z (public: void
__thiscall boost::python::instance_holder::install(struct _object *)) imported
in function "public: static struct _object * __cdecl
boost::python::objects::make_instance_impl,struct boost::python::objects::make_instance > >::execute const >(class
boost::reference_wrapper const &)"
(??$execute@$$CBV?$reference_wrapper@$$CBVhello@?A0x58ed8be9@@@boost@@@?$make_instance_impl@Vhello@?A0x58ed8be9@@U?$value_holder@Vhello@?A0x58ed8be9@@@objects@python@boost@@U?$make_instance@Vhello@?A0x58ed8be9@@U?$value_holder@Vhello@?A0x58ed8be9@@@objects@python@boost@@@456@@objects@python@boost@@SAPAU_object@@ABV?$reference_wrapper@$$CBVhello@?A0x58ed8be9@@@3@@Z)
extending.obj : warning LNK4217: locally defined symbol
?allocate@instance_holder@python@boost@@SAPAXPAU_object@@II@Z (public: static
void * __cdecl boost::python::instance_holder::allocate(struct _object
*,unsigned int,unsigned int)) imported in function "public: static void __cdecl
boost::python::objects::make_holder<1>::apply,struct
boost::mpl::vector1,class std::allocator > > >::execute(struct _object