I am trying staticaly link dmtx library into shared library (.so) which should be called then using JNI on Ubuntu 16 (64 bit)
I got weird error:
Relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
Here is command line
gcc -shared -o libSample.so -I/usr/lib/jvm/java-8-openjdk-amd64/include -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux Sample.c -fPIC -L/usr/local/lib -l:libdmtx.a
Question is what this error really means, and how to correctly statically link library into shared.so ?