簡體   English   中英

IDE編譯成功,但dcc32寫道:錯誤:E2010不兼容類型:'Integer'和'NativeInt'

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

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;

謝謝您的幫助!

檢查有問題的行。 如果它說兩個應該兼容的類型是不兼容的,那么就會發生比簡單分配更復雜的事情。 如果我不得不猜測,有些東西正在傳遞函數指針並且API已經改變了。 試着檢查那個案子......

您是否仔細檢查過您是否未使用命令行編譯Win64? (即驗證它實際上是被調用的dcc32.exe)。
在這種情況下,NativeInt是64位,這是正常的引發此錯誤。

另外,你是否嘗試使用-B選項進行完整構建 ,如( c:\\program files\\embarcadero\\rad studio\\9.0\\bin\\dcc32.exe -$O- -$W+ --no-config -B -Q ...)或使用-M選項進行簡單編譯 ,如( c:\\program files\\embarcadero\\rad studio\\9.0\\bin\\dcc32.exe -$O- -$W+ --no-config -M -Q 。 ..)?

我也會嘗試消滅所有dcus,看它是否有幫助。

由於它可以在IDE中運行,因此請嘗試捕獲“消息”區域中顯示的命令行,並在控制台中嘗試完全相同的行。

您錯誤地使用了較舊的dcc32.exe(也許是Delphi XE?)。 檢查PATH設置或在編譯中提供XE2 dcc32.exe的完整路徑。 XE2應顯示此版本信息:

Embarcadero Delphi for Win32編譯器版本23.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM