View previous topic :: View next topic |
Author |
Message |
andyjeffries Apprentice
Joined: 14 Apr 2004 Posts: 196 Location: Stevenage, Herts, UK
|
Posted: Sun Dec 12, 2004 5:14 pm Post subject: Library build error relocation/fPIC? |
|
|
Hi there,
As part of my application I distribute a statically linked library. However, when I compile the library on my new A64 box I get:
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: gtkscintilla.o: relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
gtkscintilla.o: could not read symbols: Bad value
Can anyone help me with what this means and what I have to do to make the build 32/64 bit clean?
Thanks,
Andy _________________ Developer of gPHPEdit
A8N-SLI/AMD X2 4800+/2GB Dual Channel/GF 7900GT OC |
|
Back to top |
|
|
herbie Guru
Joined: 09 Oct 2002 Posts: 319 Location: London UK
|
Posted: Mon Dec 13, 2004 12:33 am Post subject: |
|
|
Your error message gives you the solution to your problem "recompile with -fPIC". i.e add -fPIC to you CFLAGS when compileing this shared library. According to the gcc man page:
Quote: | -fPIC
If supported for the target machine, emit position-independent code,
suitable for dynamic linking and avoiding any limit on the size of
the global offset table. This option makes a difference on the m68k
and the SPARC. |
i.e you need to compile shared libs with -fPIC on amd64. |
|
Back to top |
|
|
andyjeffries Apprentice
Joined: 14 Apr 2004 Posts: 196 Location: Stevenage, Herts, UK
|
Posted: Mon Dec 13, 2004 9:28 am Post subject: |
|
|
Doh! Thanks, I was adding it to the LDFLAGS (thinking it was an error from the linker). Teach me to try and work on a Sunday
Are there any documents on how to port applications (GTK ideally) to AMD64? _________________ Developer of gPHPEdit
A8N-SLI/AMD X2 4800+/2GB Dual Channel/GF 7900GT OC |
|
Back to top |
|
|
phoolish n00b
Joined: 20 Nov 2004 Posts: 19
|
Posted: Thu Jul 07, 2005 9:11 pm Post subject: |
|
|
Tried your solution with no luck. I'll keep looking. Thanks. _________________ and karma was her middle name. ~ a friend. |
|
Back to top |
|
|
|