Mega Search
23.2 Million


Sign Up

Make a donation  
Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide

I seem still not to understand the logic of Delphi IDE paths yet...

Today I am configuring a newly installed Delphi 2009 so it can be used
with an older project that needs unicode update.
So I have installed all the needed extra component packages the way I
alwasys do including a self-made package to return TSpinEdit to Delphi
2009.
Now when I load the project I can open the form and the spinedit is
there all right. So it looks like the fact that the package is on the
Library path (the global setting) seems to make that happen.

But now when I syntax check the project in D2009 it pops up "file not
found" messages asking for the .dcu files.

Why is this?

After all it has been built into packages registered in D2009 and with
the library path set to where the packages actually reside...
Both my own custom components package file and the GLScene package
file are located there and yet it asks for these extraneous dcu (or
even pas) files.

What have I gotten wrong?
(I think I had a similar discussion some time ago but I cannot find
the thread where it was discussed now....)

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 8:02 AM EST
From: Bo Berglund
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
Bo Berglund wrote:

> I have found it to probably be a lot better to use an environment
> variable set defined in the IDE itself.

Yes, I also use this.

> I don't know from which version it was made possible to define
> internal environment variables, though.

Since D1 I believe. :)

--
Alex

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 17-Jan-2015, at 3:11 AM EST
From: Alex Belo
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
On Thu, 15 Jan 2015 12:41:51 -0800, david hoke
 wrote:

>If you opened old projects in later IDE, probably a very good chance (given 
>your report) that you have paths in your project file that are not otherwise 
>obvious to you...

Just to follow up:
I closed D2009 and then I edited the dproj file and changed all
references to D2007 for D2009.
Then when I again opened D2009 and the old project I no longer am
getting these strange path errors.
But again:
When the values were D2007 I could never see or change that in the
IDE!

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 16-Jan-2015, at 6:41 AM EST
From: Bo Berglund
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
On Thu, 15 Jan 2015 20:51:06 -0800, Alex Belo  wrote:

>Olivier Sannier wrote:
>
>> 1. Direct inclusion in the project (for PAS file only)
>> 2. Search path for the project
>> 3. Search path in the IDE.
>> 
>> Personally, I always go for solution 2 with relative folders so that
>> I can move the entire development tree to another location (or even 
>> machine) without much hassle.
>
>I use #3 for installed components: installed components in fact are
>part of IDE. Moving project on different machine requieres only
>existance of components in new IDE (no matter in what directory), so
>project contains only its own paths (not paths depending on IDE).

Ihave used environment variables in the past to define where
components and such are installed. So I use these environment
variables when specifying locations on both IDE and project level.

But now that I am juggling between all these IDE versions on my PC I
have found it to probably be a lot better to use an environment
variable set defined in the IDE itself. That way the declaration of
the variable will define exactly where the compnents are and the IDE
and project paths will be the same for each IDE, like:
${CMPBASE}\MyPackages
and for the project paths something similar unless one can fully use
relative paths.
I don't know from which version it was made possible to define
internal environment variables, though.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 16-Jan-2015, at 6:18 AM EST
From: Bo Berglund
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
Olivier Sannier wrote:

> 1. Direct inclusion in the project (for PAS file only)
> 2. Search path for the project
> 3. Search path in the IDE.
> 
> Personally, I always go for solution 2 with relative folders so that
> I can move the entire development tree to another location (or even 
> machine) without much hassle.

I use #3 for installed components: installed components in fact are
part of IDE. Moving project on different machine requieres only
existance of components in new IDE (no matter in what directory), so
project contains only its own paths (not paths depending on IDE).

--
Alex

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 8:51 PM EST
From: Alex Belo
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
On Thu, 15 Jan 2015 12:41:51 -0800, david hoke
 wrote:

>"Bo Berglund"  wrote in message 
>news:709643@forums.embarcadero.com...
>
>Did you re-create the projects from scratch, or "upgrade" them from earlier 
>version project files?

I am working to unicodify an old project that has been developed from
2001 using Delphi7, then BDS2006 and finally RAD Studio 2007.
Then I have managed to get it going in XE5, but since I got problems
insde of GLScene I decided to move back down to D2009 to add a minimum
of changes over the unicode stuff. This is where I am now and I cannot
get it to work as described.

Sources are passing through version control in each case so I check
out fresh into each IDE version tree.

>
>If you opened old projects in later IDE, probably a very good chance (given 
>your report) that you have paths in your project file that are not otherwise 
>obvious to you...

I opened the dproj file in UltraEdit and sure enough I found many path
items referencing the D2007 installation!
There are two sections, which contain a number of lines, 4 of which
have these paths inside:
{code}

$(CMP2007)\....
..\Common;$(CMP2007)\....
..\Common;$(CMP2007)\....
..\Common;$(CMP2007)\...
{code}
Both property groups contain the same 4 items.

Now the strange thing is that I cannot find anywhere in the IDE a
place to set or edit these paths.....

Notice that I have added correct paths into the IDE both for the
project and globally. There is no trace of the project entries in the
dproj file...

But when I open the project and look at project properties I can see
the paths I entered there again, but they are definitely not in the
dproj file. How very strange!

How did that happen?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 2:35 PM EST
From: Bo Berglund
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
"Bo Berglund"  wrote in message 
news:709643@forums.embarcadero.com...
>
> Even more strange is that D2009 brings up the source file with a
> highlight on where the exception happened, but using a pas file from
> my D2007 file tree!!!!
> How could D2009 even find a source file in the D2007 tree when there
> are no paths set in D2009 for that location?
>
> I had another such case while preparing D2009 for use where a
> component source file popped up during syntax checking of the main
> project. Also this was taken from the D2007 tree!!!!
>
> It seems totally weird. How could D2009 find files in the D2007 tree
> when there are no paths anywhere in D2009 pointing to D2007????
>

Did you re-create the projects from scratch, or "upgrade" them from earlier 
version project files?

If you opened old projects in later IDE, probably a very good chance (given 
your report) that you have paths in your project file that are not otherwise 
obvious to you...

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 12:41 PM EST
From: david hoke
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
Whatever version delphi, you should be able to compile new vcl and drop 
every samples unit first to see if this ones are fine and choose or D2009 or 
XE5 on same machine and remove register keys from the one or the other.



"Bo Berglund"  wrote in message 
news:709643@forums.embarcadero.com...
> On Thu, 15 Jan 2015 08:20:09 -0800, Olivier Sannier
>  wrote:
>
>>Bo Berglund wrote:
>>
>>> What have I gotten wrong?
>>
>>The IDE needs the path to the BPL file as it is that files that it loads
>>to show the components in the palette
>>The compiler, however, needs the object file to create your own EXE. The
>>object file is either located in a library of such files (DCP), in a
>>standalone file (DCU) or created from the source (PAS)
>>
>>So, for your project to compile, you must make sure the compiler finds
>>the appropriate DCP/DCU/PAS via one of these methods:
>>
>>1. Direct inclusion in the project (for PAS file only)
>>2. Search path for the project
>>3. Search path in the IDE.
>>
>>Personally, I always go for solution 2 with relative folders so that I
>>can move the entire development tree to another location (or even
>>machine) without much hassle.
>
> I did as you suggested and added the DCU folders to the compiler
> paths.
> This made the request for DCU:s go away.
>
> I use User environment variables inside RAD Studio to define the path
> to the components etc. This way I can use $(CMPXE5)\xxx in the path
> list dialogs.
>
> But now I found another strange error cropping up when I started a
> debug session of my project in D2009:
> There is an exception on startup in a GLScene module, which is strange
> because I already fixed this in XE5 yesterday and transferred the
> source changes over to the D2009 file tree via CVS. It is unicode
> related.
>
> Even more strange is that D2009 brings up the source file with a
> highlight on where the exception happened, but using a pas file from
> my D2007 file tree!!!!
> How could D2009 even find a source file in the D2007 tree when there
> are no paths set in D2009 for that location?
>
> I had another such case while preparing D2009 for use where a
> component source file popped up during syntax checking of the main
> project. Also this was taken from the D2007 tree!!!!
>
> It seems totally weird. How could D2009 find files in the D2007 tree
> when there are no paths anywhere in D2009 pointing to D2007????
>
> On my PC there are the following IDE versions installed at the moment:
> - Delphi 7
> - BDS2006
> - RAD Studio 2007
> - RAD Studio 2009
> - RAD Studio XE5
> They all have their own file tree for components (containing teh same
> stuff, but in different trees). Like CMPD7, CMPBDS2006, CMPD2007 etc.
> That is also where the packages for components are located.
>
> Should be well and truly isolated, I would think, but apparently not.
> :(

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 12:04 PM EST
From: Lieven Vandaele
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
On Thu, 15 Jan 2015 08:20:09 -0800, Olivier Sannier
 wrote:

>Bo Berglund wrote:
>
>> What have I gotten wrong?
>
>The IDE needs the path to the BPL file as it is that files that it loads 
>to show the components in the palette
>The compiler, however, needs the object file to create your own EXE. The 
>object file is either located in a library of such files (DCP), in a 
>standalone file (DCU) or created from the source (PAS)
>
>So, for your project to compile, you must make sure the compiler finds 
>the appropriate DCP/DCU/PAS via one of these methods:
>
>1. Direct inclusion in the project (for PAS file only)
>2. Search path for the project
>3. Search path in the IDE.
>
>Personally, I always go for solution 2 with relative folders so that I 
>can move the entire development tree to another location (or even 
>machine) without much hassle.

I did as you suggested and added the DCU folders to the compiler
paths.
This made the request for DCU:s go away.

I use User environment variables inside RAD Studio to define the path
to the components etc. This way I can use $(CMPXE5)\xxx in the path
list dialogs.

But now I found another strange error cropping up when I started a
debug session of my project in D2009:
There is an exception on startup in a GLScene module, which is strange
because I already fixed this in XE5 yesterday and transferred the
source changes over to the D2009 file tree via CVS. It is unicode
related.

Even more strange is that D2009 brings up the source file with a
highlight on where the exception happened, but using a pas file from
my D2007 file tree!!!!
How could D2009 even find a source file in the D2007 tree when there
are no paths set in D2009 for that location?

I had another such case while preparing D2009 for use where a
component source file popped up during syntax checking of the main
project. Also this was taken from the D2007 tree!!!!

It seems totally weird. How could D2009 find files in the D2007 tree
when there are no paths anywhere in D2009 pointing to D2007????

On my PC there are the following IDE versions installed at the moment:
- Delphi 7
- BDS2006
- RAD Studio 2007
- RAD Studio 2009
- RAD Studio XE5
They all have their own file tree for components (containing teh same
stuff, but in different trees). Like CMPD7, CMPBDS2006, CMPD2007 etc.
That is also where the packages for components are located.

Should be well and truly isolated, I would think, but apparently not.
:(

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 11:15 AM EST
From: Bo Berglund
 
Re: Why is path to dcu/pas needed for a packaged component?  
News Group: embarcadero.public.delphi.ide
Bo Berglund wrote:

> What have I gotten wrong?

The IDE needs the path to the BPL file as it is that files that it loads 
to show the components in the palette
The compiler, however, needs the object file to create your own EXE. The 
object file is either located in a library of such files (DCP), in a 
standalone file (DCU) or created from the source (PAS)

So, for your project to compile, you must make sure the compiler finds 
the appropriate DCP/DCU/PAS via one of these methods:

1. Direct inclusion in the project (for PAS file only)
2. Search path for the project
3. Search path in the IDE.

Personally, I always go for solution 2 with relative folders so that I 
can move the entire development tree to another location (or even 
machine) without much hassle.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 8:20 AM EST
From: Olivier Sannier