Главная страница | назад

Article #16837: Pascal to C++ header file causes internal error GH1281

 Question and Answer Database

FAQ1837C.txt   Pascal to C++ header file causes internal error GH1281 
Category   :IDE
Platform    :All
Product    :C++Builder  1.x

Why when trying to import a PAS file into the BCB IDE or 
attempting to build at the command line via dcc32 -jphnv
an Internal error GH1281 is generated?


A common cause of this error is demonstrated in 
the following test case.
If you are assigning a getter or setter to a record
field property of a record member of an object and 
that record also contains a user defined type 
( like an enum or a typedef ) then the compiler cannot
find the getter or setter and the internal error is 
generated. The error only happens when the user type 
comes before the field that is being used for a property
so a workaround would be to change the ordering of the 
fields. For example, to make the following test case work
move the id Integer field to first in the record. Another
workaround can be to avoid the use of an enum. For example,
changing Num to an Integer from a TNumType avoids the error.

{ this example will generate an internal error GH1281 when
compiled with dcc32 -jphnv
caused by assigning a getter or setter for a record field property
when the field comes after a user defined type in the record. An
enum is demonstrated with TNumType and a typedef  is demonstrated
with TNameType ( uncomment to test ) }

unit IntError;



    TNumType = ( One, Two );
//  TNameType = String[8];

   TCustomerInfo = record
     Num: TNumType;
 //  Name: TNameType;
     id:   Integer;

     TCustomer = class
info : TCustomerInfo;
property Fid : Integer read info.id write info.id;


7/2/98 10:32:32 AM

Last Modified: 01-SEP-99