jrcolons has asked for the wisdom of the Perl Monks concerning the following question:

Hi all! I'm trying to compile the perl GD Module with a perl 64 bits that I've compiled earlier, with GD 64 bits and stuff but somehow it is giving me errors. here's the output
gcc -B/usr/ccs/bin/ -c -I/usr/local/include -Wformat=0 -O -DVERSI +ON=\"2.45\" -DXS_VERSION=\"2.45\" -fPIC "-I/opt/perl-5.12.3/lib/CORE +" -DHAVE_JPEG -DHAVE_FT -DHAVE_XPM -DHAVE_GIF -DHAVE_PNG -DHAVE_ANIM +GIF -DVERSION_33 -DHAVE_UNCLOSEDPOLY -DHAVE_FONTCONFIG -DHAVE_FTCIRCL +E GD.c Running Mkbootstrap for GD () chmod 644 GD.bs rm -f blib/arch/auto/GD/GD.so LD_RUN_PATH="/usr/lib:/opt/pkg64/freetype/lib:/opt/csw/lib/sparcv9:/us +r/local/lib" gcc -B/usr/ccs/bin/ -G -m64 -mcpu=v9 -m64 -G -L/usr/loc +al/lib -L/usr/sfw/lib/sparcv9 -L/usr/lib/sparcv9 GD.o -o blib/arch/a +uto/GD/GD.so \ -L/opt/pkg64/freetype/lib -L/usr/lib -L/usr/lib/sparcv9 -L/usr/sfw/ +lib/sparcv9 -L/opt/csw/lib/sparcv9 -L/usr/openwin/lib -L/opt/pkg64/jp +eg/lib -L/usr/local/lib -lXpm -lX11 -ljpeg -lfontconfig -lfreetype -l +png12 -lz -lm -liconv -lgd -liconv \ ld: fatal: file GD.o: wrong ELF class: ELFCLASS32 ld: fatal: File processing errors. No output written to blib/arch/auto +/GD/GD.so collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `blib/arch/auto/GD/GD.so'
What can be going wrong? Thanks in advance!!

Replies are listed 'Best First'.
Re: Compiling GD on 64 bit perl 5.12.3 with errors
by Khen1950fx (Canon) on Apr 07, 2011 at 21:36 UTC
Re: Compiling GD on 64 bit perl 5.12.3 with errors
by Anonymous Monk on Apr 07, 2011 at 21:18 UTC
    What can be going wrong? Thanks in advance!!

    The error message explains exactly what is going wrong

    ld: fatal: file GD.o: wrong ELF class: ELFCLASS32

    IIRC, 32 is not 64, and you can't mix 32-bit and 64-bit libraries

Re: Compiling GD on 64 bit perl 5.12.3 with errors
by ikegami (Patriarch) on Apr 07, 2011 at 21:34 UTC
    Missing -m64 in compile step? (If so, why is it missing? I don't know.)