in reply to Compiling GD on 64 bit perl 5.12.3 with errors
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