views:

597

answers:

2

I found a bug in Delphi 2009's implementation of TFields and wrote a quick patch. I copied DB.pas to my projects folder and added it to the project's file list, but now I can't get it to compile. The first two error messages don't even make any sense when I go to the indicated places in the code.

Surely if anything can be counted on to compile properly, it's the code from CodeGear. They've already managed to compile it, to produce the VCL components. So what am I missing? Here's the compiler's output:

[DCC Error] DB.pas(2536): E2134 Type 'Pointer' has no type info
[DCC Error] DB.pas(10799): E2066 Missing operator or semicolon
[DCC Error] DB.pas(12933): E2217 Published field 'FCursor' not a class or interface type
[DCC Error] DB.pas(12934): E2217 Published field 'FTitle' not a class or interface type
[DCC Fatal Error] testing.dpr(23): F2063 Could not compile used unit '..\..\..\vclpatch\DB.pas'
+5  A: 

Does it help if you add the following line at the top of the DB.pas unit.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N-,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}

If it works after using this line, then your project options are not compatible with the settings that CodeGear used to compile the RTL/VCL.

BTW: Line 2536 is a line that contains only the text "type". Have you changed the file? Or are you missing Update 1?

Andreas Hausladen
That worked. And yes, that's what line 2536 is on my version too. Like I said, the first two error messages make no sense.
Mason Wheeler
+1  A: 

I ran into the same problem with DB.pas but did never modify any VCL units. So the cause clearly had to be my project. Switching Emit runtime type information to false did the trick and solved the problem.

(Project Options: Delphi Compiler -> Compiling -> Code generation -> Emit runtime type information)

Heinrich Ulbricht