Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22097

Relocation R_X86_64_32 against `.rodata' can not be used when making a shared object

$
0
0

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 ?


Viewing all articles
Browse latest Browse all 22097

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>