Forum > General

Compile without debugging information

(1/2) > >>

casimiro:
Hi, I'm using the latest version of Lazarus v2.2.0 on gnu/Linux.
I can't find the option to compile without debug information.
How can I compile without debug information?
Thank you very much and best regards.

howardpc:
Project -> Project Options...
In the "Options for Project: xxx" dialog click the Debugging node under Compiler Options in the treeview on the left.
Then uncheck the "Generate info for the debugger (slower / increases exe-size)" checkbox.

casimiro:
Perfect, thank you very much.
Regards.

 :)

Martin_fr:
This affects only your project. If packages (LCL or other) are compiled with debug info, then that does not change => Each package has it's own setting.
And many package also mix in the "configure build ide" options.

You can use "additions and overwrites" (project options / search wiki) to make changes.
This also allows to re-compile packages with more/less optimization and/or with/without range/stack/overflow-checks etc.

Note: The RTL (and FCL) are pre-build. The installers that come with Lazarus usually does install them without debug info. The IDE has no method to rebuild them. To change those (well you do likely not need, since they should match your requirements) you would need to rebuild them from the command line. (google FpcBuildFaq).

Some function names may be left in the exe, even if debug info is switched off (IIRC that happens while linking, but not sure) => just use "strip.exe" on the your compiled exe.


On top of that, note that your app always carries RTTI (well almost always...). So if you use a hex viewer you will still find some names from your source code. But that is not debug info.

casimiro:
Very interesting, thanks for the information.
I still have a lot to learn about Lazarus.
Regards.

Navigation

[0] Message Index

[#] Next page

Go to full version