Delphi DPR/Library path confusion (interference between D10 and D11) - delphi

I have Delphi 10.4 and Delphi 11.2. I find Delphi 11 too buggy to be used and I stick with my Delphi 10 (for the moment).
But Delphi 10 has also some bugs in its VCL, that were fixed in D11. So, I took Vcl.ExtCtrls.pas from D11 and copied into a separate folder (VCL_FIX). Then in Delphi 10, I include that file into my projects:
program MyProgram;
uses
FastMM4,
Forms,
...
Vcl.ExtCtrls in 'C:\Packages\**VCL_FIX**\Alexandria_VCLs\Vcl.ExtCtrls.pas';
The problem is that now, having D11 installed in parallel with D10, when I Ctrl+click the "Vcl.ExtCtrls" in the DPR file, it opens the real file from D11 ( c:\Delphi\Alexandria\source\vcl\ ), not the one from my "VCL_FIX" folder.
Why?
I don't understand how D10 gets access to D11 files... I thought they are individual installations.
And why the real D11 file takes precedence? The DPR clearly says that the file should be taken from VCL_FIX folder.

Related

Delphi 10 Seattle - little change in unit then all dcu file are recompiled

I have large project written in XE3 (about 2200 units). I did update IDE Delphi XE3 to Delphi 10 Seattle. When I adds or deletes methods in any unit (without form, without dfm) and I want running (F9), all units of project are compiling, this continues very long time. In XE3 is absent this problem. I have dcu files in the same folder. I did even new project file (dpr and dproj) in Delphi 10 but it did not work.

Delphi XE3 Fatal Compilation Error in jlcSysInfo [duplicate]

I'm migrating a Delphi 2 project to RAD Studio XE2.
When I try to compile I get
[DCC Fatal Error] MyUnit.pas(9): F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove
at the following row:
unit MyUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, DB, DBTables, TB97, ExtCtrls, Grids, DBGrids, Vcl.Mask, JvExMask,
Vcl.DBLookup,
JvToolEdit, {<-- error here}
TB97Ctls;
{...}
I tried uninstalling and reinstalling RAD Studio, JCL and JVCL, but nothing changes.
Update Was using the binary Jedi installer from A.Hausladen (intended for use in Delphi trial editions only).
You either have old DCU files lying around that need to be rebuilt, or removed, or your project or library path contents are not consistent. (Find files named JclUnitVersioning.dcu that are not in the proper JCL Library folder, and remove them. The proper library folders are named jcl\lib\d7, through jcl\lib\d16, depending on your delphi version number )
This usually means that your project has access to both a directory that is in your library-path (or project search path) that contains pre-compiled DCU files, and may also have access to some source units (.pas files), and that one or more of the units that depends on other units, was compiled at a different time than now, with multiple versions of a common unit. I wish I could draw you a picture.
Imagine you have a car, and someone upgrades the engine, changing it from a V6 to a V8. Now someone who had previously been servicing your engine comes back and tries to find the place where the V6's exhaust manifold attached. It's not there any more, it's moved. Since the new engine is frozen in its current shape (stay with me here!), your service technician simply goes back to you (the customer) and says, "sorry, I'm confused, I can't continue, I give up". That's roughly what this error message means.
Cleaning it up is possible in several ways; It may be a simple matter for you to make sure you compile 100% from .pas files, and have no Library folders containing .dcu files at all. Of course, that's hardly ideal, is it, since the whole purpose of a Library path was to contain a precompiled "library" of DCU files.
So instead, I suggest you do a cleanup (delete all your DCU files) and rebuild all your component packages from source (you do have a batch file for that purpose right?) and then review both your project's search path, and library path to see that both contain only the folders you think they should contain.
Just had the same problem with Delphi 2010 and XE3 (both on same PC while migrating).
After several hours of recompiling both my projects and the JCL projects (the installer bat file errors on my PC) discovered the problem was the order in which the directories were declared in the tools/options/Delphi Options/libraries.
Took them all out, added the version specific directory (eg lib\D14, lib\D17\Win32) and then the other JCL sub-directories required (ie one at a time until a project using JCL would build)
Simple fix:
After JCL package install, reboot your PC to apply Path change. (The installer will ask for it.)
Open from Delphi IDE the JCL package. eg.: ..\jcl\packages\d7\Jcl.dpk
Click Project menu > Build ! (do not just compile)
Save all changes, close Delphi.
Now JVCL\install.bat should work fine. Tested just now with Delphi7 Light Edition 7.3.4.3
(You may also edit that .bat file and change the first line from #echo off to echo on, to see more detailed infos, what's going on.)

F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove

I'm migrating a Delphi 2 project to RAD Studio XE2.
When I try to compile I get
[DCC Fatal Error] MyUnit.pas(9): F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove
at the following row:
unit MyUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, DB, DBTables, TB97, ExtCtrls, Grids, DBGrids, Vcl.Mask, JvExMask,
Vcl.DBLookup,
JvToolEdit, {<-- error here}
TB97Ctls;
{...}
I tried uninstalling and reinstalling RAD Studio, JCL and JVCL, but nothing changes.
Update Was using the binary Jedi installer from A.Hausladen (intended for use in Delphi trial editions only).
You either have old DCU files lying around that need to be rebuilt, or removed, or your project or library path contents are not consistent. (Find files named JclUnitVersioning.dcu that are not in the proper JCL Library folder, and remove them. The proper library folders are named jcl\lib\d7, through jcl\lib\d16, depending on your delphi version number )
This usually means that your project has access to both a directory that is in your library-path (or project search path) that contains pre-compiled DCU files, and may also have access to some source units (.pas files), and that one or more of the units that depends on other units, was compiled at a different time than now, with multiple versions of a common unit. I wish I could draw you a picture.
Imagine you have a car, and someone upgrades the engine, changing it from a V6 to a V8. Now someone who had previously been servicing your engine comes back and tries to find the place where the V6's exhaust manifold attached. It's not there any more, it's moved. Since the new engine is frozen in its current shape (stay with me here!), your service technician simply goes back to you (the customer) and says, "sorry, I'm confused, I can't continue, I give up". That's roughly what this error message means.
Cleaning it up is possible in several ways; It may be a simple matter for you to make sure you compile 100% from .pas files, and have no Library folders containing .dcu files at all. Of course, that's hardly ideal, is it, since the whole purpose of a Library path was to contain a precompiled "library" of DCU files.
So instead, I suggest you do a cleanup (delete all your DCU files) and rebuild all your component packages from source (you do have a batch file for that purpose right?) and then review both your project's search path, and library path to see that both contain only the folders you think they should contain.
Just had the same problem with Delphi 2010 and XE3 (both on same PC while migrating).
After several hours of recompiling both my projects and the JCL projects (the installer bat file errors on my PC) discovered the problem was the order in which the directories were declared in the tools/options/Delphi Options/libraries.
Took them all out, added the version specific directory (eg lib\D14, lib\D17\Win32) and then the other JCL sub-directories required (ie one at a time until a project using JCL would build)
Simple fix:
After JCL package install, reboot your PC to apply Path change. (The installer will ask for it.)
Open from Delphi IDE the JCL package. eg.: ..\jcl\packages\d7\Jcl.dpk
Click Project menu > Build ! (do not just compile)
Save all changes, close Delphi.
Now JVCL\install.bat should work fine. Tested just now with Delphi7 Light Edition 7.3.4.3
(You may also edit that .bat file and change the first line from #echo off to echo on, to see more detailed infos, what's going on.)

Delphi 7 crashes after installing Delphi XE (BPL mixed paths)

After installing Delphi XE, my good-old Delphi 7 started to crash more often. Today, I have discovered that one of my BPLs was still loaded by D7 even if I deleted it from "c:\Program Files\Borland\Delphi7\Projects\Bpl".
After I have searched the entire disk I have discovered a copy of that BPL in "c:\Users\Public\Documents\RAD Studio\8.0\Bpl".
My question is: why is Delphi 7 looking in "c:\Users\Public\Documents\RAD Studio\8.0\Bpl"?
How can I convince it to look only in "c:\Program Files\Borland\Delphi7\Projects\Bpl" ?
Delphi XE probably augments the PATH environment variable to include the Delphi XE Bpl folder. Delphi 7 doesn't know any better; it calls LoadLibrary just like everything else, and that searches the system path.
Follow the Delphi example and give your packages version-specific suffixes reflecting what version of Delphi they're for. You should be able to configure that in the project options, or else you can just have version-specific project files that already have the version suffixes in their names. That way, even if the Delphi XE version of the package is visible on the path, it won't have the right name, so Delphi 7 won't try to load it.

Trouble with IDE and VCLZIP components

What is loaded into Delphi 2010 from a dsk file that could prevent Delphi 2010 from crashing when a project is loaded?
Let me explain. It is somewhat complicated.
When I installed Delphi 2010 I put it on a large USB Western Digital hard drive (R:) with only Delphi 2010, Delphi project folders and Delphi component folders on it.
I copied all of my projects and components to the USB drive in R:\Components and R:\Projects folders. I then removed all the *.dcu files and history folders and *.dsk files so that Delphi 2010 would load the correct files that I open from Drive R.
Then I installed nearly all of my components into Delphi 2010 from folders on Drive R and tested them all with out a problem. So far over the last 7 days I have not had a problem with any of the components or projects I installed from R drive. I had thought everything was just fine until I tried loading my VclZip projects into Delphi 2010 from Drive R.
After opening a project with vclzip component... all is fine for about 15-20 seconds... then without even touching the mouse or the keyboard Delphi totally crashes and i am left at the Vista desktop with a dialog what says an exception ocurred in bds.exe in the runtime debugger.
Trouble Shooting
If I copy the *.dsk file in the project folder from Drive D ( Delphi 2009 project folder) to the project folder on Drive R, Delphi 2010 opens the project from Drive R and it does not crash, but the wrong files from my Delphi 2009 projects folder on Drive D are loaded into the Tabs (I suspect as specified from the *.dsk file). If I close the tabs in the Delphi 2010 IDE with the incorrect files and reopen the files in the ide, by double clicking them in the project group Delphi does not crash and i can compile and run the project from Drive R in Delphi 2010 with no problems.
I have been working with Delphi since Delphi 1 and I have never seen this happen before among 10's of thousands of delphi projects over the years, but I must say I naver have installed a version of delphi on a usb drive before. The other thing that is strange is why do just projects with VclZip do this? No other projects of well over a 100-200 projects and demos compiled so far in Delphi 2010 act this way.
Obvously something is wrong but I have no idea what except maybe an environment path or some incompatable code in a component. Is there an environment path that could cause Delphi to crash? An official VCLZip component is not available yet but I suspect it will be done in several days. If the component is not causing the problem does anyone have any ideas or suggestions?
Hopefully I have explained this well enough for everyone to understand.
Components are loaded into the IDE process, so any error in a component can cause problems in the IDE. I guess there is something in the version of the VCLZip components you use that makes the IDE unstable and breaks it down. So this is a showstopper, indeed, but for the VCLZip components.
Like already said, .dsk files can be discarded and should not be copied over. I generally also don't copy the .dproj files over to other directories. I rather open the .dpk or .dpr files and have a new one generated. That ensures that all directories are set correctly with the defaults, etc.
The *.dsk contains nothing important, and will in fact cause problems when you copy it between folders/computers, as it specifies where to load recent files from. I don't synch *.dsk at all, and your safe to delete it.
The DSK file stores recent file locations, form positions, window positions, watches, other debugging info (breakpoints, etc.) and other settings that don't hurt too much to lose.

Resources