static library has big size

早过忘川 提交于 2019-12-07 14:47:57

问题


I built universal static library with help of this template

The problem that is my library libWrapper.a has size 1.3 mb??? :0 while my source code has 130 kb.

How I can reduce the size of my static lib?

Other strange thing -

Each lib has the same size - 1.3 mb. I supposed that universal (fat) libs should have bigger size.


回答1:


Also make sure that you set Generate Debug Symbols to NO in your build settings. This can reduce the size of your static library by about 30%.




回答2:


in terminal run

strip -x [youStaticlib.a]

Description

For dynamic shared libraries, the maximum level of stripping is usually
 -x (to remove all non-global symbols).

if you want to know strip other parameter, in terminal run

man strip



回答3:


You cant. Static libraries include all the code that they reference in the form of frameworks inside their executable.



来源:https://stackoverflow.com/questions/11722986/static-library-has-big-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!