views:

2975

answers:

4

I'm really sick of this problem. Google searches always seem to suggest "delete all bpls for the package", "delete all dcus". Sometimes this just-does-not-work. Hopefully I can get some other ideas here.

I have a package written in-house, which had been installed without issue a few months ago. Having made a few changes to the source, I figured it was time to recompile/reinstall the package. Now I get two errors, the first if I choose "install" is

Access violation at address 02422108 in module 'dcc100.dll'. Read of address 00000000.

...or if I try to build/compile the package, I get

[Pascal Fatal Error] F2084 Internal Error: LA33

This is one of those Delphi problems that seems to occur time and time again for many of us. Would be great if we could collate a response something along the lines of "any one or combination of these steps might fix it, but if you do all these steps it will fix it...."

At the moment, I've removed all references to the bpl/dcp files for this package, but still getting the same error...

Using BDS2006 (Delphi)

Update 01-Oct-2008: I managed to solve this - see my post below. As I can't accept my own answer, I'm not entirely sure what to do here. Obviously these types of issues occur frequently for some people, so I'll leave it open for a while to get other suggestions. Then I guess if someone collates all the info into a super-post, I can accept the answer

A: 

Which Delphi version you are using?

Harriv
2006 - added this to the question
Graza
+3  A: 

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

Lars Truijens
+4  A: 

I managed to solve this, following the below procedure

  1. Create a new package
  2. One by one, add the components to the package, compile & install, until it failed.
  3. 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

Graza
I've accepted my own answer here, as it was the one that fixed it, though Lars was also very helpful. But in the interests of not having too many needlessly open questions, I've done this - not sure if it's the correct way to do things on S.O. but it will do for now...
Graza
+1 for finding it out; I'd wish I could do another +1 for reporting it in QC.
Jeroen Pluimers
+1  A: 

I had a similar case, where the solution was to remove the file urlmon.dcu from /lib/debug.

It also worked to turn off "use debug .dcus" altogether. This of course is not desirable, but you can use it to check whether the problem lies with any of your own units, or with any of delphi's units.

Elling