how to reduce size in c++?

mc 4,111 Reputation points

I used just one func in lib.

but if I do not use this func the size may be 30kb

if I use it is 150kb

but I just use one not all.

the .h file is very big. 331kb

how to reduce unused codes?

I am creating dll

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,629 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 43,051 Reputation points

    First of all, the size of a header file is unrelated to the size of a binary (.exe or .dll) that uses a function declared in the header file.

    A debug build will produce a binary that is larger than one produced by a release build. The default linker options for a release build include an option to remove unreferenced code and data from the generated binary.

    A binary that uses load-time (static) linkage to the CRT will be larger than one that uses run-time (dynamic) linkage.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful