幸福,只不过是想让快乐有一个存在下去的理由。
Q(问题):
A(解决):
编译源文件生成so文件时,命令不对。
原命令:
gcc -I /opt/jdk/jdk1.8.0_231/include -I /opt/jdk/jdk1.8.0_231/include/linux -fPIC -shared -o /opt/jni/ClassLoader.so -c /opt/jni/classloader.cpp
改为:不要-c
gcc -I /opt/jdk/jdk1.8.0_231/include -I /opt/jdk/jdk1.8.0_231/include/linux -fPIC -shared -o /opt/jni/ClassLoader.so /opt/jni/classloader.cpp