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

Delphi XE2 3 Update . The IDE successfully compiles the project, 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:

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

Thanks for the help!

+6
source share
3 answers

By default, you are using the old dcc32.exe (perhaps Delphi XE?). Check your PATH configuration or provide the full path to XE2 dcc32.exe in your compilation. XE2 should display this version information:

Embarcadero Delphi for Win32 Compiler Version 23.0

+1
source

Check the line. If he says that the two types that must be compatible are incompatible, then something more complicated than a simple assignment happens. If I were to guess something was missing a function pointer, and the API would change. Try checking this case ...

+3
source

Have you double checked that you are not compiling for Win64 with the command line? (i.e. check that it is actually dcc32.exe that is being called).
In this case, NativeInt has 64 bits, and that would be fine to raise this error.

You are also trying to complete the build using the -B option , for example ( c:\program files\embarcadero\rad studio\9.0\bin\dcc32.exe -$O- -$W+ --no-config -B -Q .. .) or a simple compilation with the -M option, for example ( c:\program files\embarcadero\rad studio\9.0\bin\dcc32.exe -$O- -$W+ --no-config -M -Q ...) ?

I will also try to destroy all dcus to see if this helps.

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

+1
source

Source: https://habr.com/ru/post/904280/


All Articles