lazarus默认配置生成的目标文件包含了大量调试信息,可以通过编译选项将不必要的去除,下面是减肥方法
1. Project|Compiler Options|Code| Smart Linkable (-CX)-> Checked
2. Project|Compiler Options|Linking|Debugging|Display Line Numbersin Run-time ErrorBacktraces (-gl) -> Unchecked
3. Project|Compiler Options|Linking|Debugging|Strip Symbols FromExecutable (-Xs) -> Checked
4. Project|Compiler Options|Linking|Link Style|Link Smart (-XX)-> Checked
The most important seem to be 2 and 3. The executable sizeshould be now 2-3 MB instead of 16 MB.
5. Run upx <your_executable> tocompress your binary by a factor of 2-3.