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!