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