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.