Embedded Python Linking Problem
exarkun at intarweb.us
Tue Feb 25 23:09:35 CET 2003
On Tue, Feb 25, 2003 at 01:16:42PM -0800, Ian Terrell wrote:
> I'm experimenting with embedding Python in C++ programs as explained
> in http://www.python.org/doc/current/ext/embedding.html. I'm having
> some trouble linking, however.
> It compiles cleanly, but can't resolve linking:
> $ g++ hello.cc -o hello
> /tmp/ccGyP0Vj.o: In function `main':
> /tmp/ccGyP0Vj.o(.text+0x11): undefined reference to `Py_Initialize'
> /tmp/ccGyP0Vj.o(.text+0x1e): undefined reference to
> /tmp/ccGyP0Vj.o(.text+0x26): undefined reference to `Py_Finalize'
> collect2: ld returned 1 exit status
Try: g++ hello.cc -o hello -L/usr/lib/python2.2/config/ -lpython2.2
A sad spectacle. If they be inhabited, what a scope for misery
and folly. If they be not inhabited, what a waste of space.
-- Thomas Carlyle, looking at the stars
up 17 days, 2:29, 5 users, load average: 0.17, 0.25, 0.26
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 196 bytes
Desc: not available
More information about the Python-list