Error embedding in C++

Mike Romberg romberg at smaug.fsl.noaa.gov
Wed May 17 20:07:36 EDT 2000


>>>>> " " == Mike Morasky <mikem at wetafx.co.nz> writes:

     > I'm embedding python in a simple c++ application that I've
     > based on the embed demo that comes with the installation. I've
     > checked to make sure I'm linking to all the libraries setup in
     > the mentioned Makefiles and yet I'm getting an Unresolved text
     > symbol error:

     > ld32: ERROR 33: Unresolved text symbol "__eprintf" -- 1st
     > referenced by
     > /local1/usr/local/Python-1.5.2/libpython1.5.a(longobject.o).

     > For the life of me, I can't seem to find the symbol or the
     > library that would resolve it.  Can anyone point me in the
     > right direction?


  I bumped into this problem a while back.  In my case, it was caused
by building python with gcc and using another compiler for the C++
application.  You will find that __eprintf is found in libgcc.a.  This
library is usually buried a bit in the backwoods of a gcc install.  My
"fix" for this was just to extract out the object file which contained
__eprintf from libgcc.a and link it into our application.  There are
probably better ways of doing this.  In our case, we were able to use
gcc for building everything.  So, the problem went away that way :).

Mike Romberg (romberg at fsl.noaa.gov)



More information about the Python-list mailing list