Building gdmodule-0.23 under Python2.1.1
Chris Gonnerman
chris.gonnerman at newcenturycomputers.net
Wed Sep 5 21:40:28 EDT 2001
(Note: I am the poor sucker who maintains this package now.)
Your problem looks like a linker error. Specifically, you are linking
gdmodule.so with libgd.a; is it PIC (Position Independent Code) on Solaris
as it is under SuSE Linux (where I do my development work)? The command
you show to compile gd object modules does not include -fPIC.
The key message seems to be:
> ImportError: ld.so.1: python: fatal: relocation error: file
> ./gdmodule.so: symbol gdImageCreateFromJpeg: referenced symbol not
> found
In particular, "relocation error" sounds a lot like a PIC/non-PIC error.
Try adding -fPIC to the gcc command (and recompile ALL the gd source files
and rebuild the library) and see if that helps.
----- Original Message -----
From: "Joe Kelly" <joek at quantiva.com>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Wednesday, September 05, 2001 12:38 PM
Subject: Building gdmodule-0.23 under Python2.1.1
> I am trying to build gdmodule.so into Python2.1.1. And it is failing.
>
> Has anyone done this successfully?
>
> It builds correctly, but when I try to import gd I get:
> 10026>mach(joek)$ python
> Python 2.1.1 (#1, Aug 31 2001, 20:46:16)
> [GCC 2.95.2 19991024 (release)] on sunos5
> Type "copyright", "credits" or "license" for more information.
> >>> import gd
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> ImportError: ld.so.1: python: fatal: relocation error: file
> ./gdmodule.so: symbol gdImageCreateFromJpeg: referenced symbol not
> found
> >>>
>
> I build gdmodule.so via:
> gcc -fPIC -g -O2 -Wall -Wstrict-prototypes
> -I/home/joek/build/python/pkg/python/reloc/include/python2.1
> -I/home/joek/build/python/pkg/python/reloc/include/python2.1
> -DHAVE_CONFIG_H -I./install/include -c ././gdmodule.c -o ./gdmodule.o
>
> ld -G ./gdmodule.o -L./install/lib -L/usr/lib/X11 -L/usr/X11R6/lib
> -lgd -lz -lpng -ljpeg -lttf -lX11 -lXpm -o ./gdmodule.so
>
>
> Libgd.a should have the gdImageCreateFromJpeg:
> It is in gd_jpeg.c:
> gcc -I. -I/home/joek/build/gd/gd-1.8.3/../current/install/include -O
> -c gd_jpeg.c
>
>
> ar rc libgd.a gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
> gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \
> gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
> gdtables.o gdttf.o gdcache.o gdkanji.o wbmp.o gd_wbmp.o
> ranlib libgd.a
>
> We have successfully built it with Python1.5.2, but not with
> Python2.1.1.
>
> The platform is Solaris on Intel.
> SunOS mach 5.8 Generic_108529-03 i86pc i386 i86pc
>
> Any help would be greatly appreciated.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
More information about the Python-list
mailing list