Collect a practical tip: view the build release time of the so file dependency in the dynamic link library in Linux

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.