Question about includes/library files...

Hello,

I assume this is a very simple question but I am not sure.

Let's say I have fancy library X which has thousands of include files and library files.

If I include all of the header files and include all of the library files in my project will that result in my executable becoming much larger?

Or are modern compilers (VC++/G++/etc.) smart enough to only include what they need regardless of how many/little of the includes are there; assuming the minimum includes/library dependencies are met?

Hope these questions make sense.

Thank you.
You could test it, but honestly exe size really doesn't matter.
Thanks; it will just be good to know for sure. I tried it with VC++ and it doesn't seem to make a difference but what do I know as a novice :)
Any sensible, modern linker, will only link object code that's actually used by the program into the final executable. So, no, it shouldn't make your exe any bigger.

However, doing things like including header files you don't need, or specifying unnecessary libraries to link against, may make compilation and link times longer than they need to be.
Topic archived. No new replies allowed.