LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   disable debug mode in gcc (http://www.linuxquestions.org/questions/linux-software-2/disable-debug-mode-in-gcc-583415/)

arunachalam 09-09-2007 01:56 PM

disable debug mode in gcc
 
hello all,

how to generate an exe in release mode for a C Program, I am using gcc for compilation.

Thanks in advance,
Arunachalam.

wjevans_7d1@yahoo.co 09-09-2007 02:20 PM

First, don't use the -g switch when you compile. Avoiding that switch will keep the extra debug information from appearing in the executable file.

Second, you can strip even externally defined globals from the executable file by using the strip command on the executable file after compilation. For more details, do this at the command line:

Code:

man strip
Hope this helps.


All times are GMT -5. The time now is 11:16 PM.