سؤال

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.

هل كانت مفيدة؟

المحلول

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.

نصائح أخرى

"Is it possible reduce the size of its static library by specifying some parameters when building it?"
Yes - build library as release
look:
Linux(32bit)
7,5 M - debug build (-O0 -g3)
~700 K - release build (-O3)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top