开发者

can i trim some modules from lib when i link it in my Makefile?

开发者 https://www.devze.com 2023-01-24 12:29 出处:网络
for example, i have a lib file named test.a. test.a have three modules: test1.o, test2.o, test3.开发者_运维问答o. i just need modules test1.o, how can i achieve this in my Makefile.

for example, i have a lib file named test.a. test.a have three modules: test1.o, test2.o, test3.开发者_运维问答o. i just need modules test1.o, how can i achieve this in my Makefile.

if anybody knows how to trim the test2.o and test3.o modules, please let me know.thanks for the help!


If you are using a static library, only the modules needed will be linked into the executable.

If you use a shared library, the whole of the library will be loaded at runtime, regardless of which functions you use from the library.

0

精彩评论

暂无评论...
验证码 换一张
取 消