Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDE compiles successfully, but dcc32 writes: Error: E2010 Incompatible types: 'Integer' and 'NativeInt'

Delphi XE2 Update 3 IDE compiles the project successfully, but dcc32.exe writes:

Embarcadero Delphi for Win32 compiler version 22.0
Copyright (c) 1983,2010 Embarcadero Technologies, Inc.
ehshelprouter.pas(137) Error: E2010 Incompatible types: 'Integer' and 'NativeInt'
ehs_reg.pas(68) Fatal: F2063 Could not compile used unit 'ehshelprouter.pas'

Why? Line 137 is:

Application.OnHelp := OnRouteHelp; // function OnRouteHelp(Command: Word; Data: NativeInt; var CallHelp: Boolean): Boolean;

Thanks for the help!

like image 573
Dmitry Avatar asked Dec 22 '11 00:12

Dmitry


3 Answers

Check the line in question. If it's saying that two types that should be compatible are incompatible, then there's something more complicated than simple assignment going on. If I had to guess, something is passing a function pointer around and the API has changed. Try checking for that case...

like image 83
Mason Wheeler Avatar answered Sep 19 '22 18:09

Mason Wheeler


Your are using an older dcc32.exe by mistake (Delphi XE perhaps?). Check your PATH-setting or provide the full path to XE2 dcc32.exe in your compilation. XE2 should display this version info:

Embarcadero Delphi for Win32 compiler version 23.0

like image 1
Ville Krumlinde Avatar answered Sep 20 '22 18:09

Ville Krumlinde


Have you double-checked that you're not compiling for Win64 with the command line? (i.e. verify it is actually dcc32.exe that is called).
In that case NativeInt is 64bits and that would be normal to raise this error.

Also, are you trying to do a full build using the -B option like (c:\program files\embarcadero\rad studio\9.0\bin\dcc32.exe -$O- -$W+ --no-config-B-Q...) or simple compile with the -M option like (c:\program files\embarcadero\rad studio\9.0\bin\dcc32.exe -$O- -$W+ --no-config-M-Q...)?

I would also try to wipe out all the dcus to see if it helps.

And since it works from the IDE, try with capturing the command line shown in the Messages area and try that exact same line in a console.

like image 1
Francesca Avatar answered Sep 18 '22 18:09

Francesca