Boost logo

Boost-Build :

Subject: Re: [Boost-build] Boost-build Digest, Vol 70, Issue 16
From: Олег Селянин (kolobok-s_at_[hidden])
Date: 2011-06-23 02:40:29


Re: Boost-build Digest, Vol 70, Issue 16 Hi Charles.

Cool. An incredible among us. While waiting a solution I continue to learn Python/C API. May be it will be easier to use the low level integration Python to C++ (extending end embedding) then wait when someone solve our problem to able us to use high level. 
Also though I don't take deep to boost.python as far as I has taken it able to extend, to embed Python, but doesn't able to combine these aproaches in one C++ program. It's a pity because I do need them both in one form one tool. It seems that my way lays to API.

Вы писали 22 июня 2011 г., 22:02:55:


Hi Kolobok,

You are not the only person suffering this pain - I got the similar build issue and I've downloaded several versions of pre-built boost.python libs, none of them are good. I'm tracing the definition of fin_static_type()  - it is defined and I can compile the object with that symbol, but after link it to the lib, the symbol just disappeared.

Cheers,
Charles


> ------------------------------

> Message: 6
> Date: Wed, 22 Jun 2011 09:27:25 +0400
> From: ???? ??????? <kolobok-s@bk.ru>
> To: boost-build@lists.boost.org
> Subject: [Boost-build] Boost.Python build trouble
> Message-ID: <313872754.20110622092725@bk.ru>
> Content-Type: text/plain; charset=windows-1251

> I'm trying to build "simple" tutorial described at http://www.boost.org/doc/libs/1_46_1/libs/python/doc/tutorial/doc/html/index.html

> #include <boost/python/module.hpp>
> #include <boost/python/def.hpp>

> char const* greet() 
> { 
> return "hello, world"; 
> }

> BOOST_PYTHON_MODULE(hello_ext) 
> { 
> using namespace boost::python; 
> def("greet", greet); 
> }

> I downloaded boost 1.46.1 sources, built them with bjam after a tons of
> headache with Python 3.2.
> My %HOME%\user-config.jam is

> # MSVC configuration
> using msvc : 9.0 ;

> # Python configuration
> using python : 3.2 : d:/Dev/Python.3.2.Source ;

> I tried to build tutorial with bjam and ms vs 2008. The only but not
> less persistent error I get in both cases is

> Error 1 error LNK2019: unresolved external symbol
> "__declspec(dllimport) struct _object * __cdecl
> boost::python::detail::init_module(struct PyModuleDef &,void
> (__cdecl*)(void))"
> (__imp_?init_module@detail@python@boost@@YAPAU_object@@AAUPyModuleDef@@P6AXXZ@Z)
> referenced in function _PyInit_hello_ext hello.obj 

> As deep as I can dig in Internet I encountered that error with this
> function car appear while PY_VERSION_HEX definition is wrong
> http://stackoverflow.com/questions/5810101/undefined-boost-python-symbol-boostpythondetailinit-module
> boost::python::detail::init_module(char const*, void (*)()) - for Python 2.x
> and
> boost::python::detail::init_module(PyModuleDef&, void (*)()) - for Python 3.x

> But the only definition for PY_VERSION_HEX I found is in %PYTHONROOT%\Include\patchlevel.h
> and here it is

> #define PY_MAJOR_VERSION 3
> #define PY_MINOR_VERSION 2
> #define PY_MICRO_VERSION 0
> #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
> #define PY_RELEASE_SERIAL 0

> #define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \
> (PY_MINOR_VERSION << 16) | \
> (PY_MICRO_VERSION << 8) | \
> (PY_RELEASE_LEVEL << 4) | \
> (PY_RELEASE_SERIAL << 0))

> as I can understand it is 0x030200xx00 that is greater then
> 0x03000000. And I'm still have the error.

> I tried to locate *.lib's contain
> init_module@detail@python@boost@@YAPAU_object@@AAUPyModuleDef@@P6AXXZ@Z.
> THere are some in %BOOSTROOT%stage\lib\ folder

> libboost_python-vc90-mt.lib 
> libboost_python-vc90-mt-1_46_1.lib 
> libboost_python-vc90-mt-gd.lib 
> libboost_python-vc90-mt-gd-1_46_1.lib 
> libboost_python3-vc90-mt.lib 
> libboost_python3-vc90-mt-1_46_1.lib 
> libboost_python3-vc90-mt-gd.lib 
> libboost_python3-vc90-mt-gd-1_46_1.lib 

> and in %BOOSTROOT%libs\python\example\tutorial\ (folder with C++ code
> fron the tutorial) library

> boost_python-vc90-mt-gd-1_46_1.lib 

> (near to which located boost_python-vc90-mt-gd-1_46_1.dll)
> But even inserting each library with its full path in project
> properties\linker\input\addiditional dependencies, as well as pointing
> %BOOSTROOT%libs\python\example\tutorial\ in project
> properties\linker\additional library directories have no positive
> effect.

> Can't even describe my emotions.

> Will appreciate any help.

> -- 
> ? ?????????,
> ???? mailto:kolobok-s@bk.ru



> ------------------------------

> _______________________________________________
> Boost-build mailing list
> Boost-build@lists.boost.org
> Unsubscribe and other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build


> End of Boost-build Digest, Vol 70, Issue 16
> *******************************************





-- 
С уважением,
 Олег                          mailto:kolobok-s@bk.ru
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk