【问题标题】:IDE compiles successfully, but dcc32 writes: Error: E2010 Incompatible types: 'Integer' and 'NativeInt'IDE 编译成功,但 dcc32 写道:错误:E2010 不兼容的类型:'Integer' 和 'NativeInt'
【发布时间】:2011-12-22 00:47:21
【问题描述】:

Delphi XE2 Update 3 IDE 编译工程成功,但 dcc32.exe 写道:

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'

为什么?第 137 行是:

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

感谢您的帮助!

【问题讨论】:

  • ehshelprouter.pas 第 137 行的代码实际上是什么样的?
  • 显示代码!!我打赌 TControl.Tag 参与其中。

标签: delphi compiler-errors delphi-xe2 dcc32


【解决方案1】:

检查有问题的行。如果说两种应该兼容的类型不兼容,那么有一些比简单赋值更复杂的事情。如果我不得不猜测,有些东西正在传递一个函数指针,并且 API 发生了变化。尝试检查这种情况...

【讨论】:

    【解决方案2】:

    您错误地使用了较旧的 dcc32.exe(也许是 Delphi XE?)。检查您的 PATH 设置或在编译中提供 XE2 dcc32.exe 的完整路径。 XE2 应该显示这个版本信息:

    Embarcadero Delphi for Win32 编译器版本 23.0

    【讨论】:

      【解决方案3】:

      您是否仔细检查过您没有使用命令行为 Win64 编译? (即验证它实际上是被调用的 dcc32.exe)。
      在这种情况下,NativeInt 是 64 位,引发此错误是正常的。

      另外,您是否尝试使用 -B 选项(如 (c:\program files\embarcadero\rad studio\9.0\bin\dcc32.exe -$O- -$W+ --no-config-B-Q ...) 或 simple compile 使用 -M 选项,如 (c:\program files\embarcadero\rad studio\9.0\bin\dcc32.exe -$O- -$W+ --no-config-M-Q...)?

      我也会尝试清除所有 dcus,看看是否有帮助。

      由于它可以在 IDE 中运行,因此请尝试捕获消息区域中显示的命令行并在控制台中尝试完全相同的行。

      【讨论】:

      • 如何在 dcc32.exe 中禁用 64 位?
      • 更新了我的答案。 Dcc32.exe 应该只溢出 32 位代码,但它真的是预期/好的 dcc32.exe 吗?
      猜你喜欢
      • 1970-01-01
      • 2012-04-26
      • 1970-01-01
      • 1970-01-01
      • 2011-10-13
      • 2011-12-22
      • 2013-09-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多