views:

876

answers:

11

When I compile our project use Delphi 2010 Trial, there has a fatal error :

[DCC Fatal Error] F2084 Internal Error: L1737

Seem's a internal error. No hint at all.

Is this a compiler bug or trial limit?

Thanks.

+4  A: 

I can't give you a definite answer. Have a look at

Internal Compiler Errors

What file does the compiler complain about? Any ideas what COULD be the problem? Any new features used that could still be buggy?

EDIT: and I think we can forget about the trial limit...that would be a very odd way to indicate the end of the trial period.

Smasher
A: 

No idea as such, but that's definitely a linker error (the code starts with L) and most of these, in turn, are related to function or operator overloading. Those can arise from compiler bugs too, though - for example, in some older Delphi versions (D5 for sure, I think it was fixed in D7) you would get a linker error when using overloaded constructors that took optional parameters.

Mihai Limbășan
A: 

I think you're using same library paths with your older delphi versions, therefore using incompatible DCUs.

Ertugrul Tamer Kara
No any old DCUs there, We cleaned them thoroughly.
dzb2k9
A: 

Things have really improved since Delphi 2009, but there are still a few Generics-related glitches in the compiler that can cause errors like this. Check if you're trying to declare generic classes or methods and then use them under unusual circumstances. If so, try and distill it down to a small, reproducible test case and report it to QC.

Mason Wheeler
+1  A: 

Make sure your paths are not mangled with those of older versions.
Make sure you delete all the DCUs used in your project, included 3rd party components (unless you have some component without the source, in that case double check you have the latest DCUs for D2010) then do a build all to regenerate all those.
Then try to cut your application in smaller parts and see what part is causing the problem: the goal is to have the simplest possible application that triggers the error, to be able to send it to Embarcadero with a reasonable chance for them to find the problem...

François
I tryed as what you said, it's seems some ui components caused this. because if I removed Application.CreateForm(TFrmMain, FrmMain) , It's just works.We used old version TMS components, VirtualTree on our MainForm.I modified the source make them can work with D2010.Maybe it's the problem.
dzb2k9
A: 

Use the way François told, we can sure it's not thirdparty components causing the problem.

We now locate two sub-project, One is ported from Java (Lucene), the other is ported from C++.

All of them can compiled in D2009 , but can not compiling in D2010.

Continue try seperating them.

dzb2k9
A: 

Finally, I found the problem.

We used one SmartPtr pattern introduced from Barry Kelly's blog, D2010's compiler consider that is invalid. and the smartptr words fine with D2009.

Thanks a lot.

By the way , I post my smartptr here :) and our region still no D2010 for selling :(

I dont know what changed in D2010 compilers's implementation.

type

TSmartPtr = class(TInterfacedObject, TFunc) private FValue: T; public constructor Create(AValue: T); destructor Destroy; override; function Invoke: T; end;

TSmartPtrArray = array of TFunc;

implementation

{ TObjectHandle }

constructor TSmartPtr.Create(AValue: T); begin FValue := AValue; end;

destructor TSmartPtr.Destroy; begin if Assigned(FValue) then FValue.Free; end;

function TSmartPtr.Invoke: T; begin Result := FValue; end;

dzb2k9
A: 

type

TSmartPtr < T: class > = class ( TInterfacedObject, TFunc < T > )

private

 FValue: T;

public

 constructor Create(AValue: T);

 destructor Destroy; override;

 function Invoke: T;

end;

TSmartPtrArray = array of TFunc < T >;

implementation

{ TSmartPtr}

constructor TSmartPtr < T > .Create(AValue: T);

begin

 FValue := AValue;

end;

destructor TSmartPtr < T >.Destroy;

begin

if Assigned(FValue) then

  FValue.Free;

end;

function TSmartPtr < T >.Invoke: T;

begin

 Result := FValue;

end;

dzb2k9
Could you explain in what way this is an answer to your question? Does this code reproduce the error? Even then it isn't really an answer but an addition to your question...
Smasher
Yes, I locate fatal error on one class of our sub-project, I can build it successfully after removed smartptr support.maybe these code triggers the problem, but can not sure for that.
dzb2k9
A: 

D2010's compiler seems still not stable ...

In my project, after removed smartptr support. I can build sub-project successfully.

But when I build (shift+f9) main project, still shows:

[DCC Fatal Error] F2084 Internal Error: L1737 Failed Elapsed time: 00:00:05.6

Then strange thing is that I modified the source -- such as add a blank line. and save (ctrl+s) and compile the project (ctrl+f9), shows:

Compiling LiveRecruit.dproj (Debug configuration) Success Elapsed time: 00:00:01.3

then Run(f9) the application, all looks fine, only I can't build the main project ...

Very very strange.

dzb2k9
A: 

This problem seems to be related to generics. I got the same problem using a local type like this:

procedure TSomeObject.SomeFunc; type TMeetDictionary = TDictionary; var ..

function SomeLocalStuff: string; begin .. end;

begin .. md := TMeetDictionary.Create; try .. some stuff also using SomeLocalStuff.. finally md.Free; end; .. end;

It goes away as soon as I commet away the use of the TDictionary.

Atle
A: 

Include for the other post by "Atle":

It also goes away when "type TMeetDictionary = TDictionary<..>" is moved outside the procedure.

Atle