2

I have a C++ Windows application that uses STL, boost and several other libs. Application does not do much but have a big size. I have to find a way to reduce the size of the app, but I do not understand which part of these libraries blows up the size of my app.

(Maybe I can switch STL/boost, or implement smth by myself, or do smth by a different way, etc...)

Does we have any tools/guides to investigate imported symbols and find out which give biggest increment to the size of the app?

UPDATE

I'm asking about release build.

I do not ask about configuration of compiler, but I ask about the tool that will tell what parts of my code give the biggest increase of the size of my app.

All libs included statically. Therefore if I could remove heavy-weight dependencies size of the app will be significantly smaller.

Victor Mezrin
  • 2,797
  • 2
  • 32
  • 48

2 Answers2

1

Boost is big library. If you need Boost you do not need STL.

If STL is enough for your needs then you can use just STL.

Also, I think you can configure Visual Studio to print to the output the trace of the linking process.

Some ideas for inspecting libs are here:

How to See the Contents of Windows library (*.lib)

Tools for inspecting .lib files?

Community
  • 1
  • 1
sg7
  • 6,108
  • 2
  • 32
  • 40
  • Ok. For example I need boost.thread. I can use flag `/VERBOSE:LIB` and see that my app linked against this lib. But I do not know list of the methods imported from the lib. And I do not know size of the methods... – Victor Mezrin Jun 10 '16 at 23:00
  • @VictorMezrin I added some possibly helpful links from stackoverflow. – sg7 Jun 10 '16 at 23:21
-1

Are you looking at debug build? That might be bigger. What about doing strip on the executable?

Drakosha
  • 11,925
  • 4
  • 39
  • 52