简体   繁体   中英

How to link one static C library which uses other library

I have a library ('A') which uses other library ('B'). Now, I have developed a program which uses 'A' library. Should I link my project to the 'A' library or the both libraries? In my previous experiments, I joined the both libraries to my projects and It worked but maybe this method is not reasonable!

You need to link both libraries with your code. If you don't get the linking right, the linker will complain about unresolved references to functions. Also, be aware that the GCC linker at least is sensitive to the order of libraries on the command line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM