如何重新编译对 VCL 源文件 (Menus.pas) 的修改? [英] How to recompile modifications to VCL source file (Menus.pas)?

查看:20
本文介绍了如何重新编译对 VCL 源文件 (Menus.pas) 的修改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个修改过的 menus.pas.

We have a modified menus.pas.

uses ...,Controls,...;

编译器引发了致命错误:

The compiler raised a fatal error:

[DCC 致命错误] Menus.pas(*): F2051 Unit Controls 编译为不同版本的 Menus.TPopupMenu

[DCC Fatal Error] Menus.pas(*): F2051 Unit Controls was compiled with a different version of Menus.TPopupMenu

尝试过:

删除了项目中的所有dcu.

deleted all dcu in the project.

构建

构建所有

尝试将文件添加到库路径,这会导致添加 db 文件夹(也来自 vcl),然后添加到

tried adding the file to library path which leads to add db folder(from vcl too) and then to

[DCC 错误] jpeg.pas(872): E2065 不满意的前向或外部声明:'jpeg_save_markers'

[DCC Error] jpeg.pas(872): E2065 Unsatisfied forward or external declaration: 'jpeg_save_markers'

这是一个死胡同.

删除了controls.dcu(全部3个),delphi不知道自动重新编译它们,而是报告controls.dcu丢失了.

deleted the controls.dcu (all 3) and the delphi did not know automaticaly to recompile them, instead reported that controls.dcu is missing.

推荐答案

以下是我如何处理对 VCL 源文件的修改:

Here is how I handle modifications to VCL source files:

  • 在您的项目结构中制作该文件的副本.要么将该文件添加到您的项目中,要么确保搜索路径找到您修改后的文件.
  • 进行修改,但仅限于实施部分.如果您使用任何其他使用您正在修改的单位的单位,您将无法修改界面部分.
  • 在修改后的源文件顶部显式设置编译器选项.使用默认的 Delphi 选项,在默认的 vanilla 项目中按 CTRL+O O 即可找到.

我猜最后两个要点之一是让你绊倒的东西.

I'd guess that one of the final two bullet points is what is tripping you up.

这篇关于如何重新编译对 VCL 源文件 (Menus.pas) 的修改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆