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

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

问题描述

我们修改了menus.pas。



  uses ...,Controls,...; 

编译器提出了一个致命错误:


[DCC致命错误] Menus.pas(*):F2051单元控件是用
a编译的不同版本的Menus.TPopupMenu


尝试:



已删除项目中的所有dcu。



build



建立全部



尝试将档案加入库路径,导致添加db资料夹然后到


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

$



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

解决方案

VCL源文件:




  • 在项目结构中复制文件。

  • 进行修改,但只能在实施部分中进行修改。如果您使用自己使用您要修改的单位的任何其他单位,您将无法修改界面部分。

  • 在修改的源文件的顶部显式设置编译器选项。



我猜想最后一个两个点是什么是绊倒你。


We have a modified menus.pas.

At

uses ...,Controls,...;

The compiler raised a fatal error:

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

tried:

deleted all dcu in the project.

build

build all

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

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

which is a dead end.

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

解决方案

Here is how I handle modifications to VCL source files:

  • Make a copy the file in your project structure. Either add the file to your project, or make sure the search path finds your modified file.
  • Make modifications, but only in the implementation section. You are not able to modify the interface section if you use any other units that themselves use the unit you are modifying.
  • Explicitly set the compiler options at the top of the modified source file. Use default Delphi options, as found by pressing CTRL+O O in a default vanilla project.

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

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

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