[C++-sig] Boost-python failure to build basic example demo

2018-12-11 Thread arnout diels
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 

Re: [C++-sig] Boost-python failure to build basic example demo

2018-12-11 Thread arnout diels
An update, I finally managed to build it.

I tried to summarize it here: 
https://stackoverflow.com/questions/29053172/boost-python-quickstart-linker-errors/53707304#53707304
[https://cdn.sstatic.net/Sites/stackoverflow/img/apple-touch-i...@2.png?v=73d79a89bded]

c++ - Boost.Python Quickstart Linker Errors - Stack 
Overflow
I also saw that incompatible PDB format issue, but only with 1.57, which (since 
the Boost.Python source is the same for 1.57 and 1.55 and I can get it working 
on 1.55) I'm guessing is somehow related to the changes in the boost::build 
path.
stackoverflow.com



Note that I needed to patch the jamroot file, the sources themselves, and 
tools\build\src\tools\msvc.jam to get this working.

Hope someone finds the time to fix this at some point.

Kind regards,
Arnout


From: arnout diels
Sent: Monday, December 10, 2018 1:23 PM
To: cplusplus-sig@python.org
Subject: Boost-python failure to build basic example demo

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




___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig