So I\'ve been coding something on 32-bit and yesterday I needed to build a dll and I had a couple of problems with that. Anyway I solved them here.
Unfortunately eve
I also meet this problem. As I try using @Mare and @user2391685 said, it can work well :
Using -fPIC
when comepile to .o
file :
For example:
gcc -Wall -fPIC -c hello.c -I./ -I/usr/lib/jvm/java/include/ -I/usr/lib/jvm/java/include/linux/
Then you can build a .so
file :
gcc -Wall -rdynamic -shared -o libhello.so hello.o Main.h -I/usr/lib/jvm/java/include/ -I/usr/lib/jvm/java/include/linux/