Hi,
I want to create a two-level library development in #mcuxpresso. One library which contains a lower level of APIs and second above that use of this API and use as a superset of both library. Now I am able to create library both library file but I am unable to link first .lib with second .lib.
Thanks in advance.
Solved! Go to Solution.
The easiest way is really if you build a library with all the object files. As pointed out by the Stack Overflow article of Con Verse, you can use ar to combine libraries but this is not straight forward. The easiest way is using 'thin' libraries (option T) but this requires the object files accessible. Or use the libtool (GNU Libtool- GNU Project - Free Software Foundation )
Thanks @ErichStyger @converse for the response.
Right now I have solved the issue by adding all source files to my library project. So Now all the object file creates one single lib(.a) file. I have not looked into linking the binary as that looks also promising.
try swap the order of the two libraries (link order).
Thanks, ErichS for response.
Yes, I understand we could include 2 lib files in the application project and these two libs can communicate with others in the application project. But my objective is to create one lib project which includes a previously build the library. And include only one lib to the application project.
Regards.
The easiest way is really if you build a library with all the object files. As pointed out by the Stack Overflow article of Con Verse, you can use ar to combine libraries but this is not straight forward. The easiest way is using 'thin' libraries (option T) but this requires the object files accessible. Or use the libtool (GNU Libtool- GNU Project - Free Software Foundation )
A library is not 'linked' it is just a collection of object files inside a container file - its a little like a zip file. The archive utility (ar - arm-none-eabi-ar) is used to create a library.
You can merge to libraries
linux - How to merge two "ar" static libraries into one? - Stack Overflow
Note that the ar utility is called arm-none-eabi-ar