Linux View the dependencies of the dynamic link library so file on the related build __linux

Source: Internet
Author: User

Many of our C programs are presented in the form of DLLs in Windows, and Linux is shown in so form.

Windows generally does not have DLL files that cannot be executed because the compiler version of the DLL file is different.

But under Linux, the C program compiled under Linux with different versions of the kernel is prone to problems that cannot be performed under other versions of Linux. The main possibility is that the kernel of the support program is higher than the kernel at compile time or the version is lower than the kernel at compile time.

How do we see if the dynamic-link library file (so suffix) provided to us by others is available under the current Linux system? First we need to see if the relevant file he depends on exists, check the command as follows: LDD file.so

If I want to see if Jnative's dynamic link library is supported under a version of Linux, first switch to the directory where the file is located, and then write the following command:

LDD libjnativecpp.so

If normal, the display is 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)
  may appear as follows if not normal:

./libjnativecpp.so:/lib/tls/libc.so.6:version ' glibc_2.4 ' 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 for the famous Jni third party class library, and the error message above shows that our libjnativecpp.so is compiled under the 2.4 kernel and the current kernel version is not supported. After viewing, my current Linux version of the kernel is 2.6 higher than the libjnativecpp.so compile-time kernel.


Turn from: http://blog.csdn.net/kongqz/article/details/4027912

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.