tags:

views:

231

answers:

3

In this question (link) it was said that the line below (in each unit) would remove as much RTTI as possible:

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

The posting didn't mention what Delphi version it works with, but I assume D2010. However, when I include the line above, I get this error:

    DCC Fatal Error: E2158 System unit out of date or corrupted: 
    missing TVisibilityClasses.

I'm using a "stock" version of D2010 and have never done anything that I'm aware of that would change the default installation or the libraries.

Any suggestions? TIA

Related question: link.

+2  A: 

The new RTTI is for Delphi 2010 and up.

It can be removed, but then lots of things will have limited functionality (like JSON conversion, part of DataSnap and many of the newer 3rd party libraries that do ORM or other mappings).

Things depending on TValue are gone anyway.

"old style" RTTI (which was introduced in Delphi 1 and is still present in Delphi 2010) cannot be removed.

So: it is recommended to remove RTTI only from your own units, and not from the RTL and VCL.

--jeroen

Jeroen Pluimers
+3  A: 

Make sure you put the "{$RTTI" line below the "unit unit1;" line.

Giel
Working with suggestion led me to discover that the line fails only if it's in an include file. Putting the line in the .dpr (Thanks, Mason!) itself eliminated the problem. Exe size went from 35 megs to 32 megs. That's helpful as we try to shoehorn our app onto a CD. @Remy: thanks for the DVD suggestion. Our concern is that many customers are running older machines that don't have DVDs! :-( Thanks all for the help!
Robert Frank
@Robert: please file a bug at http://qc.embarcadero.com on this. Or send me a small sample project (anything starting with my first name at pluimers dot com will do).
Jeroen Pluimers
A: 

Consider putting some of the CD content on your corporate website for users to download.

Robert Harvey