[C++-sig] Boost.Python embedded doubt
Eric Jardim
ericjardim at gmail.com
Wed Aug 31 17:15:07 CEST 2005
2005/8/31, Stefan Seefeld <seefeld at sympatico.ca>:
>
> Please note that I recently added some functions specifically to make
> embedding more convenient. There are three new functions: 'exec',
> 'exec_file',
> and 'import'.
> I'm not sure where to look for the updated reference manual, as the
> official
> one doesn't contain my additions yet.
> In the process I removed the (outdated) 'embedding' test and replaced it
> with 'exec', which may be useful as an example. FWIW.
Fine, this is good. I'll search for it.
As your C++ application now acts as the python interpreter itself, it
> has to provide all the symbols from the python runtime.
?! What do you mean by that? Should I link to the "dl.so" manually? How
should I do it? If I import the "sys" module, everything goes fine. I am a
few confused of what to do (so many scopes).
Sorry, I never wrote an embedded python app before.
I don't think so. But in the past only the static python library was
> provided.
You can use "--enable-shared" at the configure.
>> >> -L/path/to/python/lib/python2.3/config -lpython2.3
> > -L/path/to/boost/lib -lboost_python-static -lutil
>
The missing symbols are provided by the python runtime, so linking
> to the python library (static or dynamic shouldn't matter) should
> do the trick.
But I am linking to the python static lib (with "-lpython2.3"). There might
me something else. The strange thing is that I am linking to the python
static lib, and on the import it gives this error:
Traceback (most recent call last):
File "<string>", line 3, in ?
File "Qt/__init__.py", line 8, in ?
ImportError: /g0dv/Bin/Linux/python/lib/python2.4/lib-dynload/dl.so:
undefined symbol: _Py_NoneStruct
Thanks,
[Eric Jardim]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20050831/8917e64e/attachment.htm>
More information about the Cplusplus-sig
mailing list