How to connect libraries and troubleshoot/usr/bin/ld:skipping incompatible problems in the library connectivity issues makefile

Source: Internet
Author: User

about how to connect to the library, here only to record some of the problems you encounter

Write makefile

compile-time-C to generate an. o file: followed by-I (indicates the included header file)

- o build executable file at link time:-L (indicates location of library)-L (indicates the name of the library)

There is also a problem referencing the JSON library:
There are two folder include and Lib folders under Lib file
There is a folder JSON in the Include folder, which contains the JSON header file
Static library with Libjson.a in Lib file

When writing makefile, note that the compile-time introduction header file directory to include the line

When writing a base_json.h file: A file referencing json #include "Json/json.h"

Today in the project, with make command appeared/usr/bin/ld:skipping incompatible ... Problem.
This problem is essentially a problem where the library file version does not correspond to the platform version when the library file is linked.
Solution: Objdump-p LIBMYLIB.A to see the version of the library is 32 or 64, or arm version or. Wait a minute. Analyze it carefully. You'll suddenly be foggy. (My problem is: The compiler chose version 64, but the XXX.A is version 32, of course incompatible)

Conclusion: These days encountered a lot of problems, these pits have to be a step on their own, will have a better harvest.

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.