I have a seemingly unsolvable (to me!) problem.
If I start a simple vcl forms app and try to compile, I get multiple warning/errors as follows :
[DCC Warning] SysUtils.pas(6082): W1000 Symbol 'SInvalidInteger' is deprecated: 'Use SysConsts.SInvalidInteger'
etc.
[DCC Fatal Error] Variants.pas(1071): F2092 Program or unit 'Variants' recursively uses itself
The library path options both in the global and project sections seem Ok,
but if I hover over the dcc32.exe build or output messages, I can see a vast selection of
paths which are not relevant and also are repeated about 3 times.
The dcc32.cfg is quite short and seems Ok.
It looks like the path is corrupt somehow and although I've reinstalled D2009 (after deleting the program) and also cleared the registry, I cannot seem to solve this problem.
question : how can I reset or clear this dcc32.exe path - where is the option file, or is it created on the fly?
This problem occurred when I tried to compile a D7 project/or added JCL/jvcl (now removed)
Thanks for any ideas!
Related
I'm currently involved in a Delphi XE5 project and I'm facing a problem that I could not solve. I have a Delphi project group that conists of one EXE; this EXE loads multiple runtime BPL's dynamically. These BPL's are also part of the project group. However, when I run the application, I got the error 'Project {MyProject.exe} raised exception class EPackageError with message 'Cannot load package 'PumpMethod'. It contains unit 'FlEdit', which is also contained in package 'eXtractionUnitMethod'.
I already searched on SO, and I've found the cause. Especially Is "implicitly imported" always a bad thing in Delphi packages? was of big help. During compilation, both BPL's of my project, emit the following message:
[dcc32 Warning] PumpMethod.dpk(46): W1033 Unit 'FlEdit' implicitly imported into package 'PumpMethod'
Other one as well:
[dcc32 Warning] eXtractionUnitMethod.dpk(46): W1033 Unit 'FlEdit' implicitly imported into package 'eXtractionUnitMethod'
But the point is that FlEdit, a textbox control that allows only the input of floats, is already part of an installed package. This package, 'Spark190.bpl', contains the control, and thus also the FlEdit unit. I've registered it and the control appears on the Tool palette. This is the project with the control:
There is also a project DclSpark190.bpl, but that is a design time package (contains the registering of the controls). When I close this project group and create a new one, I can drag/drop 'My float edit' on a form, and this runs all fine.
When I now open the project group with the EXE, and build the BPL's I got this message:
This again seems okay for me. The Spark package (with the FlEdit) is now included in the 'requires' list:
But when I compile again, the 'the following changes...' is shown again. That looks abnormal to me; the Spark BPL is already included in the requires list? So:
Q1: Why is that happening? Is it a bug in Delphi XE5? Do I something wrong here?
Also, the 'FlEdit' implicitly imported into package 'PumpMethod' is still not away:
So:
Q2: I think I've put FlEdit in a separate package 'Spark'. Both BPL's contain 'Spark' in the required package list, but still the warning (W1033) is shown. What else can I do?
Error E2200 is to be expected if you try to put the same unit X into two different named packages, Y and Z. It is NOT expected when the name of the package is the same on both the left and the right side of the error message. It is also odd that the above spurious or confusing E2200 is most often accompanied by E2213, bad packaged unit format.
I see intermittent compiler errors in this form, which was clearly intended to warn users that they are putting the same unit into two different packages, yet it sometimes occurs that it gives you this message with the same package basename on the left and on the right, in the case below, note the Jacob-Two-Two error message. You can't put that in ZZLibD16, because it's already in ZZLibD16. This error is confusing to users, including me, and yet I've seen this many times, and already worked out how to get around it.
[DCC Error] ZZLibD16.dpk(82): E2200 Package 'ZZLibD16' already contains unit 'ZZChartComboBox'
[DCC Error] ZZLibD16.dpk(83): E2200 Package 'ZZLibD16' already contains unit 'ZZComboBox'
[DCC Error] ZZLibD16.dpk(84): E2200 Package 'ZZLibD16' already contains unit 'ZZDBComboBox'
[DCC Error] ZZLibD16.dpk(85): E2200 Package 'ZZLibD16' already contains unit 'ZZDBGrid'
[DCC Error] ZZLibD16.dpk(86): E2200 Package 'ZZLibD16' already contains unit 'ZZQuery'
[DCC Error] ZZLibD16.dpk(87): E2200 Package 'ZZLibD16' already contains unit 'ZZTable'
[DCC Error] ZZLibD16.dpk(88): E2200 Package 'ZZLibD16' already contains unit 'ZZTrackBar'
[DCC Fatal Error] RSLibD16.dpk(308): E2213 Bad packaged unit format: ZZSomething.dcp.ZZUnitX - Expected version: 23.0, Windows Unicode(x86) Found version: 0.0, Unk(x86)
I believe that the normal cause of this strange "You can't put X in Y" where error is some "bad package hygiene" practice, and I have suspicions about what the fixes are, but I wonder if anyone has researched this and can definitively answer what one should do.
I normally try to resolve it by looking for duplicate copies of DCP files and cleaning up the duplicate or extra copies. I am aware of that part of this question. What I'm wondering is, is there something you can do to avoid the IDE breaking your computer and generating bad DCUs? For example, I have long suspected that by avoiding having packages and projects have any paths common to their input (search) and output (DCU output and DCP output) paths, one can avoid this problem. Is that the case? If not, what is the way to prevent such problems? What organizational rules in your project search and library search paths will avoid this problem?
In some cases the following is enough: Right click on every project in your group and clean. Now build again, problem goes away, for a while, only to return. In other cases, I have more complex sets of packages to build, and the only workable workaround is NOT to build from the IDE at all, but rather to build from msbuild from a batch file. In yet other cases, I find it helps to change all packages from "Rebuild as needed" to "Explicit rebuild". I am in fact, not able to understand or really "solve" or prevent the problem, and only able to work around it by various kludges. Has anyone got a better understanding, who can explain the cause and solution of such package strange problems, including the "bad packaged unit format"?
In the question above, I am specifically using Delphi XE2, but I think that a similar answer should be applicable for all versions of Delphi from about 2010 and up.
Go to "C:\Users\Public\Documents\Embarcadero\Studio", Rename folder "21.0" to "21.0_" and restart Delphi and Give a Try
I have a set of components in split runtime/designtime packages for Delphi XE2. I've had these for a long time and have had no problems like what I'm having now. I added a new basic control called TJDWebcam. All was fine until I decided to change the type name to TJDWebcamView. I did a find/replace in the main source unit where I have this class, and made some other changes, also in the design-time package's registration unit.
The problem is that now when I build the run-time package, I get a message saying that it requires its self (It requires a package JDComponents which is exactly the same package). I've uninstalled the package, and tried to re-build, but same error.
Here's the specific message I'm getting...
Add JDComponents.
JDComponents contains implicit unit(s) uPickFolder, JDCommon,
JD.VSample, JD.VFrames, NativeJpg.
...and every unit in the package which are OK to be there. The problem didn't start until I changed this control's type name and went to re-compile.
Now if I ignore that message and hit 'Cancel' everything seems to install fine, despite the warning that it "might cause errors".
For what reasons might it be doing this? And how to go about fixing it? I'd hate to have to post my entire component library to be debugged.
PS - My library makes use of the delphi version suffix (160 for XE2) and my own version suffix (2), so the package names actually read JDComponents.160.bpl.2 and DCLJDComponents.160.bpl.2.
UPDATE
I managed to get it installed, please see my answer below.
After doing these following steps, I managed to get it re-built successfully:
Uninstalled the package
Deleted all DCU's, package, and anything compiled
Restarted the PC
Re-build everything
So the source of the problem is still unknown, but most likely somewhere in a compiled file (DCU or the package), it was still referring to this old type name from before it got changed. When the compiler came across this, it got confused and told me I had to include this other package, which is actually the same package.
After Downloading the source, tried to compile the code.
The first bump was missing Jedi components, so downloaded jcl-2.2.1.3817-partnerdvd
Next step was installing , which was fine.
Now After Compiling , the error message is :
[DCC Fatal Error] Utils.pas(4): F2051
Unit JclCompilerUtils was compiled
with a different version of
JclSysUtils.IJclCommandLineTool
tried to download diffrenct versions, however the owner of the code claim it was compiled with 2.2.
Ideas how to resolve this?
edit: i just removed some references to the jedi from the library path, i hope didn't do any damage. still no go.
EDIT 2: downloaded the 0.57 and not the default resulted in:
[DCC Fatal Error] Utils.pas(4): F1026
File not found: 'JclBorlandTools.dcu'
now it seems as a simple version problem with jcl, ill reinstall(again).
Most Delphi error and warning messages are pretty clear, but "Compiled with a different version" errors are one of the few exceptions. What it really means is:
Something in Unit JclSysUtils (or one of its dependencies) has changed, and Unit JclCompilerUtils, which has a dependency on JclSysUtils, needs to be recompiled now, but only the DCU for it is available. Unable to locate the PAS file to recompile it.
Try making sure that the original source code for all the JCL units is available to the compiler.
I have checked my settings. I have compiled latest revision of delphipi using JCL 2.2.1.3886.
My library path contains following paths:
C:\Users\Public\Documents\Soft Gems\Virtual Treeview\Source
C:\Components\jcl-2.2.1.3886\lib\d14
C:\Components\jcl-2.2.1.3886\source\include
Delphipi depends three external libraries which are JCL, dxgettext and Virtual Treeview and links to these libraries are listed in the homepage of the project. I think you should check double check your JCL installation and library paths. Sorry, there is nothing else I can do about this. Good luck.
Is there a way to force the Delphi compiler to display all hints and warnings all the time?
Here is the behavior that I am currently seeing in Delphi 6:
Check out fresh copy of my application from source control
Open project in Delphi and Compile
All hints and warnings for the project are displayed
Make a change in one unit
Compile
Only the hints and warnings for the changed unit are displayed
So, I thought maybe I can trick Delphi by deleting all of the dcu files to force it to recompile everything. No luck. The compiler does in fact recompile all of the units, but does not display the hints and warnings for those units.
EDIT: Performing a full build (Project > Build) yields the same unfortunate results.
NEW INFORMATION: If I modify a unit and then Compile, I get the warnings. However, if I modify a unit and then Build, I do not get the warnings. I'm thinking this points to warnings being turned off somewhere. Possibly in a third party library?
It seems there ought to be a way to ask Delphi to re-display all of those hints and warnings that doesn't require me to either check out a fresh copy from source control or modify each unit one-by-one.
Hints and Warnings are generated by the compiler. It will only report on units that it has compiled. The "compile" command will only compile files that have changed. To force a recompilation of all units used by your project, use the Build command instead.
Later versions assign a shortcut key (Shift+F9) to the "Build" command.
To get that keyboard shortcut in Delphi 6, install this utility, which I've used for a while with great success on Delphi 5.
I would check to see if you turn the warnings off in some of your units.
Depending on the last change in the units, the compiling order can change. In some cases the warnings can remain disabled for a unit that is compiled after while, when freshly checked out of version control, it was compiled before, with the warnings.
Pay extra attention to any Include file you may use.
I had the same problem and finally i found solution... Search for strings $WARNINGS OFF and $HINTS OFF, and not just from *.pas files but from all the files. I had this strange idea in third-party .inc file:
{$IFDEF DEBUG}
{$WARNINGS ON}
{$HINTS ON}
{$ELSE}
{$WARNINGS OFF}
{$HINTS OFF}
{$ENDIF}
If you use dcc32.exe, all warnings will be shown, always. (This is another reason why I use build scripts for all my projects.)
I am still using D6 for some projects and if I do a full build then all hints and warnings are displayed/re-displayed. For syntax check or compile only changed unit messages are displayed.
You have something else wrong or damaged somewhere. Try deleting the project .dsm and the .dof files (they will be rebuilt) the .dof file contains the warnings and hints flags.