LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-31-2005, 01:07 PM   #1
cocteau
LQ Newbie
 
Registered: Dec 2004
Distribution: Fedora Core 3
Posts: 5

Rep: Reputation: 0
What does 'recompile with -fPIC' mean


Hi

I've been trying to compile various things on my AMD64 and I have gotten this error a few times. It starts out well, but when making shared objects I get this:

/usr/bin/ld: ./testmess.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
./testmess.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

I've no idea what that means. I've tried to look for an explanation for this elsewhere, but the replies seems to cryptic for a relative newbee.

I'm running Fedora Core 3, kernel 2.6.10 and recent versions of gcc and whatelse... whatever up2date keeps me up to date with.

Hope anyone can help.
 
Old 03-31-2005, 01:32 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
gcc -c -fPIC tesjunk.c

this tells the compiler to make an object testjunk.o that we are going to use as part of a larger shared object library

namely

gcc -shared -fPIC -o libtestjunk.so testjunk1.o testjunk2.o

so then you can make

gcc -o testapp testappobject.o -L. -ltestjunk

edit: oh yea it stands for -flag:Position Independant Code

Last edited by foo_bar_foo; 03-31-2005 at 01:34 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recompile 2.6 mgberry Slackware 4 08-25-2005 10:41 AM
recompile 2.4 in 9.2 alaios SUSE / openSUSE 4 02-10-2005 04:51 AM
instead of recompile machiner Linux - Newbie 1 07-22-2004 10:55 AM
Can't recompile...Please help!!!!! Viking Linux - General 7 04-08-2004 10:33 PM
how recompile Santas Linux - Software 2 09-08-2003 04:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration