[C++-sig] Shed Skin Python-to-C++ Compiler

Roman Yakovenko roman.yakovenko at gmail.com
Tue Jul 4 08:40:16 CEST 2006

On 7/4/06, Mark Dufour <mark.dufour at gmail.com> wrote:
> Hello all,
> Having just released version 0.0.11 of my optimizing Python-to-C++
> compiler, I thought why not ask around here if there is any interest
> in helping out.

I think I can help you with design of code generator. I created code
generator for
Boost.Python library and I am very pleased with it's design. It is
very powerful and simple.
So if you want, we can discuss it.

> scart at akemi ~/projects/shedskin $ g++ -I/usr/include/python2.4
> -lpython2.4 pb.cpp
> /tmp/ccqUfrVQ.o: In function `main':
> pb.cpp:(.text+0x151): undefined reference to
> `boost::python::api::object::object(boost::python::handle<_object>
> const&)'
> /tmp/ccqUfrVQ.o: In function `_object*
> boost::python::expect_non_null<_object>(_object*)':
> pb.cpp:(.gnu.linkonce.t._ZN5boost6python15expect_non_nullI7_objectEEPT_S4_+0xd):
> undefined reference to `boost::python::throw_error_already_set()'
> collect2: ld returned 1 exit status

It seems to me that the problem is that you did not build Boost.Python
right( == using bjam ). Or may be you forgot to add it to link line?

> Where I'm trying to compile the simple embedding example:
> #include <boost/python.hpp>
> using namespace boost::python;
> int main() {
>     Py_Initialize();
>     object main_module((handle<>(borrowed(PyImport_AddModule("__main__")))));
>     Py_Finalize();
See one of the recent threads. Py_Finalize could not be used with Boost.Python

Roman Yakovenko
C++ Python language binding

More information about the Cplusplus-sig mailing list