LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-15-2014, 08:32 AM   #1
bsv89
LQ Newbie
 
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
-fPIC error at the make step


Hello everyone,

I'm trying to compile a .so libs using gcc. At the last(make) step, I'm getting the following error:

Quote:
gcc -fPIC -shared -Wl,-soname,liblametritonus.so.1 -o liblametritonus.so.1.0 org_tritonus_lowlevel_lame_Lame.o lameapi.o -lmp3lame
/usr/bin/ld: //usr/lib64/libmp3lame.a(lame.o): relocation R_X86_64_32S against `bitrate_table' can not be used when making a shared object; recompile with -fPIC
//usr/lib64/libmp3lame.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [liblametritonus.so.1.0] Error 1
Here is what I have in my Makefile:

Quote:
prefix=/usr
JAVADIR=$(prefix)/lib/jvm/java-7-openjdk-amd64/
REL_JAVAEXTLIBPATH=jre/lib/
JAVAEXTLIBPATH=$(JAVADIR)/$(REL_JAVAEXTLIBPATH)
OSNAME=linux
ARCHNAME=
CC=gcc
DEFINES=-DUSE_LAME_API
CPPFLAGS=-g -Wall -I$(JAVADIR)/include -I$(JAVADIR)/include/$(OSNAME) -fPIC -D_REENTRANT $(DEFINES)
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL}
LN_S=ln -s
RM_F=rm -f
MKDIR_P=mkdir -p
...
I use the following configuration
Quote:
Sysyem: ubunta 64
GCC Version: 4:4.8.2-1ubuntu6
Make Version: 3.81-8.2ubuntu3
Ant Version: 1.9.3-2build1
I already red many topics of that problem such as HOWTO fix -fPIC errors and threads on this site. Only one what I understood(I'm rly bad with linux) is that I need to set -fPIC flag on, but as I can see it already on. Can anyone explain whats going wrong?

Thanks for your advice!
 
Old 08-17-2014, 07:13 AM   #2
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
You are linking your program (shared) against a 64bit version of static lame library; the fastest way is to recompile lame with -fPIC option (it's a CFLAG) and then recompile again your program
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LFS 7.5 | Step 5.6.1 Error make headers_check thehunt33r Linux From Scratch 9 03-29-2014 08:13 AM
[SOLVED] make error while compiling perl (LFSv7.2 Step 5.28) aashayshah Linux From Scratch 34 03-03-2013 04:42 AM
LXer: Complete Step by Step Guide to Make ISO Images in Ubuntu LXer Syndicated Linux News 0 06-09-2011 02:20 PM
Error recompile with fPIC, but fPIC is already as a compilation option eolmsan Linux - Software 4 12-03-2008 11:05 AM
about -fpic/-fPIC option for gcc George2 Programming 2 09-04-2006 01:38 AM

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

All times are GMT -5. The time now is 05:12 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