[Stackless] Trouble linking on Ubuntu Linux

Simon Pickles sipickles at hotmail.com
Sat Jan 12 14:49:55 CET 2008

Well, I made a little progress.

I used grep to find PyChannel_new in:

/home/simon/Source/Stackless/release25-maint/libpython2.5.a (the new 
version including stackless?)

and manually copied it over:

 /usr/local/lib/python2.5/config/libpython2.5.a (the old version without 

Then the program compiles and link! Woot I thought!

However I get a seg fault when running it. The debugger in code::blocks 
IDE with g++ points to a problem quite deep in Py_InitializeEx().

I think my manual copy of the library is bad. How come make install 
didn't do that? I guess I've got two copies of python (at least in 
parts) on my machine:


Is this causing some problem? My linux experience is still limited, so 
not so hot on controlling installation locations etc :)

Thanks for any advice


Linux user #458601 - http://counter.li.org.

Simon Pickles wrote:
> Hi,
> I can't quite get linkage to work with c++ to stackless python, it 
> worked with Cpython. I can use stackless in the python interpreter okay too.
> I thought I had rebuilt the boost.python library with stackless 
> included, but it seems not.
> I used:
> simon at simon-desktop:/usr/local/boost_1_34_1$ sudo bjam --with-python stage
> This is building using the python code in /usr/local/include/python2.5 
> (if I move this directory, the above bjam command fails).
> bjam runs sucessfully and copies the libs to 
> /usr/local/boost_1_34_1/stage/libs.
> However, when I try and integrate a stackless python type like 
> 'PyChannel_new' in c++, it says undefined reference. Note, these 
> commands do not cause an error so I guess I am linking to the old library?
>   Py_SetProgramName(argv[0]);
>   Py_InitializeEx(0);
> /usr/local/boost_1_34_1/stage/libs is in my linker search path, and I 
> have linked with option -lboost_python. Have I missed something?
> Thanks
> Simon

More information about the Stackless mailing list