Page 1 of 1

Unit scoping

Posted: Mon Sep 14, 2015 3:53 pm
by 16575142
Hi,

I hope this is the right place to ask. I am using Delphi XE8 and I have VCL application.

When I added VCLTee prefix to Unit Scope Names in Project options, compiler still reported missing units if I use it:
uses TeEngine -> 'TeEngine.pas' cannot be found!

Then I added VCLTee prefix in Tools->Environmental settings->Delphi Options -> Library and compiling was succesful. Why is it so?

I expected it would be enough to add VCLTee prefix in Project Options. I read XE8 help about unit scoping but I am still a bit confused. On the other hand I would like to keep this settings on project level not as general environmental settings.

Can you tell what am I doing wrong?

Thank you in advance.

Re: Unit scoping

Posted: Tue Sep 15, 2015 10:10 am
by yeray
Hello,
PoLabs wrote:When I added VCLTee prefix to Unit Scope Names in Project options, compiler still reported missing units if I use it:
uses TeEngine -> 'TeEngine.pas' cannot be found!
I'm not sure why this happens; it works fine for me.
Note there are several "Target"s to select. Maybe you added the prefix to a different configuration/platform than the one you are compiling against.
If I add "VCLTee" to the "All configurations - All platforms" target, a new VCL Delphi project with a chart on the form builds fine for both Win32&Win64 and both Debug&Release modes, even if I remove the "VCLTee" prefix from all the units in the uses clause.

Re: Unit scoping

Posted: Tue Sep 15, 2015 10:26 am
by 16575142
My current project doesn't include path to precompiled units of TeeChart in Search path because I am setting it up in Library. So I have to add VCLTee to Unit Scope in Library settings. Which makes sense now. That way I never recompile TeeChart sources because they are already.

I made a small demo which explained me the difference. But thank you for your effort anyways.

kind regards

Re: Unit scoping

Posted: Wed Sep 16, 2015 9:30 am
by yeray
Hi,

I'm glad to hear you found the complete explanation!