简体   繁体   English

设计时包无法构建 - 找不到文件:'Graphics.dcu'

[英]Design-time package fails to build - File not found: 'Graphics.dcu'

In Delphi XE2, I have a single control in a pair of design/run time packages. 在Delphi XE2中,我在一对设计/运行时包中有一个控件。 Originally, everything was working fine. 最初,一切都很好。 I've built each of them many times already. 我已经多次建造了它们。 Suddenly without warning, the design time package started complaining in one of my units that the Graphics unit is missing when I build. 突然间没有任何警告,设计时间包开始在我的一个单位抱怨我构建时缺少Graphics单元。 Graphics is a standard unit, but it's not found from this one place. Graphics是一个标准单位,但在这一个地方找不到它。 I haven't even made any changes to this unit, and as far as I know, any changes that could affect this. 我甚至没有对这个单位做过任何改动,据我所知,任何可能影响这个的变化。

Here's just the uses at the top (interface) of this unit: 这里只是本单元顶部(界面)的用途:

uses
  Graphics, ColorConv, Classes, Dialogs, ZLib;

As you can see, it's a very simple unit, and I only make very simple changes to this project. 正如您所看到的,它是一个非常简单的单元,我只对这个项目进行了非常简单的更改。 What could make it start complaining about this out of nowhere? 有什么可以让它开始抱怨这一点?

The strange thing is that it all works fine if I install it, it just doesn't build. 奇怪的是,如果我安装它,一切正常,它只是不构建。

There's quite a bit of code, and I'd hate to have to post the entire thing. 有相当多的代码,我不想发布整个事情。

Wild guess: it needs the Vcl. 狂野猜测:它需要Vcl. namespace prefix? 名称前缀?

Check your paths in Tools->Options->Environment Options->Delphi Options->Library , in particular the Library Path and Browsing Path settings. Tools->Options->Environment Options->Delphi Options->Library检查路径,特别是Library PathBrowsing Path设置。 The defaults for my installation of XE2 (excluding those added by third-party components and my own stuff): 我安装XE2的默认设置(不包括那些由第三方组件和我自己的东西添加的):

Library: 图书馆:

c:\program files (x86)\embarcadero\rad studio\9.0\lib\Win32\release;c:\program files (x86)\embarcadero\rad studio\9.0\Imports;C:\Users\Public\Documents\RAD Studio\9.0\Dcp;c:\program files (x86)\embarcadero\rad studio\9.0\include;

Browsing: 浏览:

$(BDS)\SOURCE\VCL;$(BDS)\source\rtl\common;$(BDS)\SOURCE\RTL\SYS;$(BDS)\source\rtl\win;$(BDS)\source\ToolsAPI;$(BDS)\SOURCE\IBX;$(BDS)\source\Internet;$(BDS)\SOURCE\PROPERTY EDITORS;$(BDS)\source\soap;$(BDS)\SOURCE\XML;$(BDS)\source\db;$(BDS)\source\Indy10\Core;$(BDS)\source\Indy10\System;$(BDS)\source\Indy10\Protocols;$(BDS)\source\fmx;$(BDS)\source\databinding\components;$(BDS)\source\databinding\engine;$(BDS)\source\databinding\graph;$(BDS)\source\fmi;$(BDS)\source\data;$(BDS)\source\data\ado;$(BDS)\source\data\bde;$(BDS)\source\data\cloud;$(BDS)\source\data\datasnap;$(BDS)\source\data\dbx;$(BDS)\source\data\dsnap;$(BDS)\source\data\Test;$(BDS)\source\data\vclctrls;

Also, since you're new to XE2, you may want to check to see (outside the IDE) if you have an environmental variable for PLATFORM defined. 此外,由于您是XE2的新用户,您可能需要查看(在IDE之外)是否有定义的PLATFORM环境变量。 Some PC manufacturers (HP as a particular example) define this variable on their computers, and it interferes with the IDE's requirements. 一些PC制造商(HP作为一个特例)在他们的计算机上定义了这个变量,它干扰了IDE的要求。 (The IDE uses PLATFORM as a temporary environmental variable in paths used for different platforms, which fails if there's one predefined outside the IDE.) You can check by opening a command prompt and typing SET PLATFORM and hitting Enter . (IDE使用PLATFORM作为用于不同平台的路径中的临时环境变量,如果在IDE外部预定义了,则会失败。)您可以通过打开命令提示符并键入SET PLATFORM并按Enter键来进行检查 If there's one pre-defined, it can cause various hard to track down problems; 如果有一个预先定义的,它可能导致各种难以追踪的问题; you can remove it safely on every machine I've run across. 你可以在我遇到的每台机器上安全地删除它。 (Right-click My Computer or Start->Computer , choose Properties , Advanced System Settings , Environmental Variables .) (右键单击My ComputerStart->Computer ,选择PropertiesAdvanced System SettingsEnvironmental Variables 。)

if there are several declaration of graphics(or other VCL units like:controls,forms ...)in your project, you can add VCL namespace to your project 如果项目中有多个图形声明(或其他VCL单元,如:控件,表单......),则可以将VCL命名空间添加到项目中
as follows: 如下:

 project menu-->options-->delphi compiler->>add in "unit scope names" value "Vcl" 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM