Jump to content
alogrep

Error E2010 incompatile types are same types

Recommended Posts

Hi.

Delphi Tokyo.

I get thie compiler message

[dcc32 Error] PngImageList.pas(385): E2010 Incompatible types: 'Vcl.Imaging.pngimage.TPngImage' and 'Vcl.Imaging.pngimage.TPngImage'

I can't figure out what it means and how to go about fixing it.

Anybody please can help?

Share this post


Link to post

Clearly you have got some code. The code is what you are trying to compile. The error message tells you what line of code causes the error.

 

If it used to compile, something changed. What? 

  • Like 1

Share this post


Link to post

Unfortunately I had not taken note of that. But know the whole Delphi is gone bananas. I build and install a Package but it does not show in the pallete. I get all kinds of other error. Like "cannot complie used unit printers". I need to keep the source code compatible with XE+ and before XE. So I cannot put Vcl.printers (or otherwoise the non XE compiler would not work)

Share this post


Link to post

"types"  is the same if "the ancestral" is the same!

 

type
  TMyType1 = class(TForm);
  TMyType2 = class(TForm);

procedure TForm1.Button1Click(Sender: TObject);
var
  lType1: TMyType1;
  lType2: TMyType2;
begin
  // lType1 := lType2; // incompatible types
  // if (TMyType1 =  TMyType2) then;  // incompatible types
  // if (lType1 = lType2) then; // incompatible types
  ...
end;

 

Edited by emailx45

Share this post


Link to post
57 minutes ago, alogrep said:

I build and install a Package but it does not show in the pallete

Check your paths, sometimes Delphi starts comparing same named DCUs built with different compiler directives.

 

Share this post


Link to post

Thanks everybody. I had to re-create the project dpr from scratch. It is not th first time. There are too many things somewhat hidden in too many places . I can't see any difference in the paths now (at least where I can find them defined) from before. Howevber, it works

Share this post


Link to post
On 12/19/2020 at 10:01 PM, alogrep said:

No. It's a huge project and I can't compile it. It used to compile fine .  

Did you install any software or packages recently that changed your system's "path" variable? 

 

The Windows PATH variable has a limited maximum length. If setup routines keep adding entries to it then it may get truncated and all sorts of things on your system stop working properly. Like Delphi not finding its installed BPL's anymore.  Happens to me all the time.

 

Some component manufacturers (like TMS) store BPL's in non-standard locations and that regularly causes me headaches for this reason. I really wish component manufacturers would stop doing that. 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×