Troubleshooting Link-time symbolic dependency issues for Linux. So

Source: Internet
Author: User
Problem description

Target:a.out

So:libmyfile.so

Dependency Description :

A.out:libmyfile.so

libmyfile.so:libssl.so.1.0.0

libssl.so.1.0.0:libcrypto.so.1.0.0

Because of the problem of make parameter, it is shown that when generating a.out, error myfile.so has reference to undefined symbol, and the symbol appears in libcrypto.so.1.0.0;

Suspicious scenario

Specify the-l parameter, then add the Ssl,crypto dependency to the-l parameter to make, and compile successfully;

Questions:

From the dependencies, it is obvious that my build target is dependent on libmyfile.so, and the relationship with Libmyfile.so's dependencies should be transparent. Why it needs to be added to the parameters of the target in this layer;

Formal methods

Careful inspection of the error message will find that this is an LD error, LD indicates the use of-rpath designated library loading directory;

Therefore, in addition to the libmyfile.so dependency and the library search directory, we should specify the path of the library load-time dependencies for the LD when generating the a.out target;

It is very simple to place so in the same directory, specifying the-rpath parameter when generating an executable target, so that the LD automatically searches for dependencies.

Troubleshooting Link-time symbolic dependency issues for Linux. So

Related Article

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.