How to solve Delphi's [Pascal Fatal Error] F2084 Internal Error: LA33?
I managed to solve this, following the below procedure
- Create a new package
- One by one, add the components to the package, compile & install, until it failed.
- Investigate the unit causing the failure.
As it turns out, the unit in question had a class constant array, eg
TMyClass = class(TComponent)
private
const ErrStrs: array[TErrEnum] of string
= ('', //erOK
'Invalid user name or password', //erInvUserPass
'Trial Period has Expired'); //erTrialExp
protected
...
public
...
end;
So it appears that Delphi does not like class constants (or perhaps class constant arrays) in package components
Update: and yes, this has been reported to codegear
These are bugs in the compiler/linker. You can find many references of these bugs on the internet in different Delphi versions, but they are not always the same bugs. That makes it difficult to give one solution for all those different kind of problems.
General solutions that might fix it are, as you noted:
- Remove *.dcp *.dcpil *.dcu *.dcuil *.bpl *.dll
- Rewrite your code in another way
- Tinker with compiler options
- Get the latest Delphi version
I personally found one of such bugs to be resolved if I turned off Range Checking. Others are solved if you don't use generics from another unit. And one was solved if the unit name and class name was renamed to be smaller.
And of course you should report any problem you have on http://qc.codegear.com
Maybe the following step will be a better solution:
Declare the array as a type and just define the class constant with this type, eg.
TMyArray = array[TErrEnum] of string;
TMyClass = class(TComponent)
private
const ErrStrs: TMyArray
= ('', //erOK
'Invalid user name or password', //erInvUserPass
'Trial Period has Expired'); //erTrialExp
protected
...
public
...
end;
This makes the array declaration explicit.