Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

static library has big size

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 -

enter image description here

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

like image 341
Injectios Avatar asked Dec 12 '22 23:12

Injectios


2 Answers

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%.

like image 164
g_low Avatar answered Dec 21 '22 11:12

g_low


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
like image 44
Ghost Clock Avatar answered Dec 21 '22 10:12

Ghost Clock