Search code examples
log4cplus

How to reduce the size of static library of log4cplus


I tried log4cplus. It is quite handy and meet our requirement. The only problem of it is it is too big. After compiling, the static library of it is about 11M big on Linux(64bit).

Is it possible reduce the size of its static library by specifying some parameters when building it?

I tried 'strip --strip-all' but I got some undefined reference error when linking the library to my program.


Solution

  • You could manually edit the source and remove Appenders that you will not be using. Also realize that by default, the compiled library does contain debugging information. And third, 11 MiB is really nothing.