Many of our C Programs are displayed in the form of DLL in windows, while in Linux, they are displayed in the form of SO.
In Windows, the first DLL file cannot be executed because the compiler version of the DLL file is different.
However, in Linux, C programs compiled in Linux of different versions of the kernel are prone to execution failures in other versions of Linux. The main reason is that the kernel of the Support Program is higher than the kernel at compilation or the version is lower than the kernel at compilation.
How can we check whether the dynamic link library file (with the so suffix) provided by others can be available in the current Linux system. First, we need to check whether the dependent files exist. The command is as follows: LDD file. So
If I want to check whether the dynamic link library of jnative is supported in a certain version of Linux, switch to the directory where the file is located, and then write the following command:
LDD libjnativecpp. So
If it is normal, It is shown as follows:
Libstdc ++. so.6 =>/usr/lib/libstdc ++. so.6 (0x0069c000)
Libm. so.6 =>/lib/tls/libm. so.6 (0x00111000)
Libgcc_s.so.1 =>/lib/libgcc_s.so.1 (0x00562000)
Libc. so.6 =>/lib/tls/libc. so.6 (0x00134000)
/Lib/ld-linux.so.2 (0x0097b000)
If it is abnormal, it may be shown as follows:
./LibJNativeCpp. so:/lib/tls/libc. so.6: version 'glibc _ 000000' not found (required by./JNativeCpp. so)
Libstdc ++. so.6 =>/usr/lib/libstdc ++. so.6 (0x0047e000)
Libm. so.6 =>/lib/tls/libm. so.6 (0x00111000)
Libc. so.6 =>/lib/tls/libc. so.6 (0x0056e000)
Libgcc_s.so.1 =>/lib/libgcc_s.so.1 (0x00c3d000)
/Lib/ld-linux.so.2 (0x0097b000)
Here is the default lib of the famous jni third-party class library. The error message above shows that our libJNativeCpp. so is compiled under the 2.4 kernel, which is not supported by the current kernel version. After checking, my current linux version has a kernel 2.6 higher than the kernel at libJnativeCpp. so compiling.