views:

209

answers:

5

i have use delphi xe recently but exe size is very big because of rtti(i think)

howto remove rtti , and can i make my application size as small as delphi 2009 application(490 kb) without comprssion; and what is the use of rtti

+5  A: 

Read the Online Help for Delphi ...

... and search Stack Overflow:

Keep in mind that the $RTTI directive has to be included in every unit where it should take effect. See How can I set the $RTTI directive for the entire project?

splash
+1 for the links to background info, though it would have been nice had you provided the statement gabr now did directly in your answer.
Marjan Venema
+5  A: 

In short (full story provided by links in the splash's answer):

{$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])}

gabr
+1 for the exact statement, which you would otherwise need to find by digging through the docs as they are mostly geared towards how to use it instead of how to turn it off.
Marjan Venema
is there any performance advantages because of RTTI
Vibeeshan
@Vibeeshan: No, just the code size difference.
gabr
Your RTTI statement, when used on my D2010 results in the compiler error: DCC Fatal Error: E2158 System unit out of date or corrupted: missing TVisibilityClasses. Any suggestions?
Robert Frank
Only this: http://docwiki.embarcadero.com/RADStudio/en/E2158_%25s_unit_out_of_date_or_corrupted_-_missing_'%25s'_%28Delphi%29 Are you trying to recompile system unit? Maybe you should ask a new question here - more people will see it that way.
gabr
+4  A: 

check this useful article

Shrinking large Delphi 2010 executables - removing RTTI properly

RRUZ
+1  A: 

I do not think it is RTTI what adds so much size overhead to your application. How do you know it is?

FractalizeR
+3  A: 

Your problem is not related to RTTI. If you are talking about relatively small increase (100-200K), this is due to extra functions in RTL (added for Unicode support etc). If you get 500-700K increase or so, then check whether you link VCL UI units (Forms, Controls etc). If you get 3Mb increase, then you've turned on extra debug symbols.

Eugene Mayevski 'EldoS Corp
but i think Unicode is already in Delphi 2009 (basic app only 499 kb ) but theres is no large improvement in Delphi xe vcl (delphi xe app size 800 kb)so ithink the extra 300 kb is mosty form RTTI. and d2007 apps (without unicode is ~350 kb)
Vibeeshan
And why do you think RTTI was not present in Delphi 2009?
Eugene Mayevski 'EldoS Corp