top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to reduce a size of executable ?

0 votes
465 views

My binary is too large and QA is suggesting to reduce its size. What are the possible measures can be tried to reduce the size?

posted Jan 16, 2015 by Harshita Dhaliwal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

Use dynamic libraries instead of static library. Do Code reuse ability where ever required, use dynamic allocation more. This way you can optimize exe.

answer Jan 16, 2015 by Naren Badsara
0 votes

Please avoid to use debugging flags and use compiler optimization options. These things may help you out.
For example: GCC compiler uses -g option to enable debugging and also -O1, -O2, -O3 etc flags to optimize the code.

answer Jan 17, 2015 by Harshita
Similar Questions
+3 votes

Is there a way to append a list of files as an executable to the file itself such that the file is still executable?

For example let's say I have 2 files file1 and file2. How might I append the the files in a way to the binary. Again this is a simple example, I would like to have a cross Operating System way to extract Unix and Windows functions. Cross operating system way to append zips (or tar.gz) to a file only to extract it later.

The following illustrates how the files might be extracted and or created.

create ./a.exe ./output.exe file1 file2

extract output.exe
0 votes

I have a png file which I want to reduce in size and dimension. Do we have any command in ubuntu/linux to achieve the same?

Thanks in advance and sorry for hiding my identity.

...