Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-08

Problem with Includes during Design Time

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Brunner

I get this error message when I'm in the IDE and try to double click any component on the form instance.

TCodeToolManager.HandleException: "include file not found "uTempSearchUserInteractionDefinitions.inc"" at Line=78 Col=7 in "/mnt/Developer/Source/Projects/SCS/uStorage.pas"

My -Fi options and Other Sources Options both contain

$Env(BUILD_SOURCE_STORAGE_SCS)/

Pulled from ENV
BUILD_SOURCE_STORAGE_SCS=/mnt/Developer/Source/Projects/SCS/Stored This just started happening... I would assume right after I had edited the project using the Project Inspector... I wanted to remove those auto-assigned units from the main project file.

I can build the project just find... I just can't do anything with the main form in Designer IDE...

uStorage.Pas and the INC file are located at BUILD_SOURCE_STORAGE_SCS path which is confirmed in the environment variable.

What could cause the CodeToolManager to throw this exception and place the curser in the uStorage.pas unit at that line even though the paths are established?
The only thing I had done before that was to clean up (remove) some units from the main project using the project inspector that were automatically added to the project.

This problem is locking me out of assigning /creating events to Widgets on the form so it's a critical problem here.

Reply by email

Mattias Gaertner
to Andrew Brunner
Show quoted text 6 lines
I get this error message when I'm in the IDE and try to double click any component on the form instance. TCodeToolManager.HandleException: "include file not found "uTempSearchUserInteractionDefinitions.inc"" at Line=78 Col=7 in "/mnt/Developer/Source/Projects/SCS/uStorage.pas"

Where is uTempSearchUserInteractionDefinitions.inc? What is the exact file path?

Show quoted text 6 lines
My -Fi options and Other Sources Options both contain $Env(BUILD_SOURCE_STORAGE_SCS)/ Pulled from ENV BUILD_SOURCE_STORAGE_SCS=/mnt/Developer/Source/Projects/SCS/Stored

There is a directory "Stored" at the end, that is not in the above file.

This just started happening... I would assume right after I had edited the project using the Project Inspector... I wanted to remove those auto-assigned units from the main project file.

What do you mean with auto-assigned units?

Show quoted text 5 lines
I can build the project just find... I just can't do anything with the main form in Designer IDE... uStorage.Pas and the INC file are located at BUILD_SOURCE_STORAGE_SCS path which is confirmed in the environment variable.

If the include file is in the same directory as the file that contains the include directive (I guess this is here the case), then it should find the include file even without any search path. Unless you added some subpath to the include directive or the case does not match.
What is the exact file name of the unit, the include file and what exactly is your include directive?

You can see the include search path of every file in source editor's popup menu / file settings / unit info / include paths.

Show quoted text 6 lines
What could cause the CodeToolManager to throw this exception and place the curser in the uStorage.pas unit at that line even though the paths are established? The only thing I had done before that was to clean up (remove) some units from the main project using the project inspector that were automatically added to the project.

Mattias

Reply by email

Andrew Brunner
to Mattias Gaertner
Mattias Gaertner wrote
Where is uTempSearchUserInteractionDefinitions.inc? What is the exact file path?

/mnt/Developer/Source/Projects/SCS/Stored/ is the path to the unit file and it's includes which are many included in the unit. Its folder has 74 items all but one (the unit) and it's includes.

Show quoted text 8 lines
> My -Fi options and Other Sources Options both contain > > ? ?$Env(BUILD_SOURCE_STORAGE_SCS)/ > > Pulled from ENV > ? ? ?BUILD_SOURCE_STORAGE_SCS=/mnt/Developer/Source/Projects/SCS/Stored There is a directory "Stored" at the end, that is not in the above file.

No, the -FI options work. The bug would be with Lazarus not reading or accepting ENV variables as vaild PATHs.

Show quoted text 5 lines
> This just started happening... I would assume right after I had edited > the project using the Project Inspector... I wanted to remove those > auto-assigned units from the main project file. What do you mean with auto-assigned units?

Yes. It was b/c uStorage.pas was a unit added to the project itself which in turn resulted in the path being added the include paths. And when I go to the project inspector I can duplicate the error EVERY time by removing the uStorage.pas unit from the project.

Show quoted text 13 lines
> I can build the project just find... I just can't do anything with the > main form in Designer IDE... > > uStorage.Pas and the INC file are located at BUILD_SOURCE_STORAGE_SCS > path which is confirmed in the environment variable. If the include file is in the same directory as the file that contains the include directive (I guess this is here the case), then it should find the include file even without any search path. Unless you added some subpath to the include directive or the case does not match. What is the exact file name of the unit, the include file and what exactly is your include directive?

things like are included in the uStorage.pas unit {$i uTempSearchUserInteractionDefinitions.inc} It would be wise to note that FPC has no issue actualy building the project... This is a Lazarus only issue that can be consistently duplicated. (see above for duplication)

You can see the include search path of every file in source editor's popup menu / file settings / unit info / include paths.

Yes indeed ".../Stored/" the path is listed paths here BUT only when I add the unit to the project and NOT by the Compiler options page setting of $Env(BUILD_SOURCE_STORAGE_SCS)/ which tells me this is where the problem is.

Show quoted text 9 lines
> What could cause the CodeToolManager to throw this exception and place > the curser in the uStorage.pas unit at that line even though the paths > are established? > The only thing I had done before that was to clean up (remove) some > units from the main project using the project inspector that were > automatically added to the project. Mattias

Yes. All I did to get the project to work in the IDE was to re-add the uStorage.pas unit to the actual project which in turn caused Lazarus to start scanning that folder for the includes.

Thanks for your thoughts. I'm able to continue but this is a bug.

Reply by email

Mattias Gaertner
to Andrew Brunner
Show quoted text 9 lines
On Sat, Aug 15, 2009 at 10:52 AM, Mattias Gaertner wrote: > > Where is uTempSearchUserInteractionDefinitions.inc? > What is the exact file path? /mnt/Developer/Source/Projects/SCS/Stored/ is the path to the unit file and it's includes which are many included in the unit. Its folder has 74 items all but one (the unit) and it's includes.

Let's see if I got this right:

unit file:
/mnt/Developer/Source/Projects/SCS/uStorage.pas

include file:
/mnt/Developer/Source/Projects/SCS/Stored/TempSearchUserInteractionDefinitions.inc

include directive:
{$i uTempSearchUserInteractionDefinitions.inc}

So, the unit "....uStorage.pas" needs the include path "Stored".

How to do this in lazarus:
- Add the unit to a project or package
- Add the include path to this project (or package)

[...] The bug would be with Lazarus not reading or accepting ENV variables as vaild PATHs.

It does accept the ENV macro in paths. But project search paths are only used in project directories.
And package search paths are only used in package directories.

Show quoted text 5 lines
[...] Yes. It was b/c uStorage.pas was a unit added to the project itself which in turn resulted in the path being added the include paths. And when I go to the project inspector I can duplicate the error EVERY time by removing the uStorage.pas unit from the project.

This is not a bug, it is a feature.

Otherwise your project will not be portable.

[...]

Mattias

Reply by email

Andrew Brunner
to Mattias Gaertner
Show quoted text 13 lines
> Yes. ?It was b/c uStorage.pas was a unit added to the project itself > which in turn resulted in the path being added the include paths. ?And > when I go to the project inspector I can duplicate the error EVERY > time by removing the uStorage.pas unit from the project. This is not a bug, it is a feature. Otherwise your project will not be portable. >[...] Mattias

Ok. So if the project paths includes the ENV variable then why would the unit need to be added to the project? This is not good. On a Windows Build the path to that folder will be different than it is on Windows. And as I understand the problem now, I will be required to add the uStorage.pas into the project and maintain a different project for each build machine.

I'm looking to get this system up and running and as automated as I can. Having to manage multiple projects for the same compile is IMO not portable enough. What can I do to remove the unit from the project but still have Lazarus not crash every time I click on a component - and I am asserting that this is not a feature - it's a flaw.

However, once the project is developed I *would* be able to bypass Lazarus on the official build machines - right? Meaning the entire premise for my discovery of this problem is that I am using $ENV() for establishing libraries and includes so that I can maintain many different native builds for x64 and 32 Windows and Linux and MAC.

Otherwise your project will not be portable.

Could you explain to me as to why a project is portable by not respecting my $ENV pointers in Lazarus's Compiler options GUI for the specific feature of "include paths??

Reply by email

Mattias Gaertner
to Andrew Brunner

On Sat, 15 Aug 2009 18:54:52 -0500
Andrew Brunner wrote:

First this:

Show quoted text 5 lines
> Otherwise your project will not be portable. Could you explain to me as to why a project is portable by not respecting my $ENV pointers in Lazarus's Compiler options GUI for the specific feature of "include paths??

With portable I mean: You can simply copy the project and the required packages to another machine and compile it there. You don't need to set up search paths (nor env variables).

Show quoted text 7 lines
[...] Ok. So if the project paths includes the ENV variable then why would the unit need to be added to the project? This is not good. On a Windows Build the path to that folder will be different than it is on Windows. And as I understand the problem now, I will be required to add the uStorage.pas into the project and maintain a different project for each build machine.

No.
You can use
a) packages
b) use target macros in the "Other unit files". e.g. $TargetCPU, $TargetOS

I added some help to
http://wiki.lazarus.freepascal.org/Multiplatform_Programming_Guide#Projects.2C_packages_and_search_paths

Show quoted text 6 lines
I'm looking to get this system up and running and as automated as I can. Having to manage multiple projects for the same compile is IMO not portable enough. What can I do to remove the unit from the project but still have Lazarus not crash every time I click on a component - and I am asserting that this is not a feature - it's a flaw.

It crashes?
Please create a bug report.

Show quoted text 5 lines
However, once the project is developed I *would* be able to bypass Lazarus on the official build machines - right? Meaning the entire premise for my discovery of this problem is that I am using $ENV() for establishing libraries and includes so that I can maintain many different native builds for x64 and 32 Windows and Linux and MAC.

There are various ways for building without installing lazarus:

lazbuild requires only the following parts of the lazarus folder:

lazbuild.exe
packager/units/*

There is no installer for lazbuild alone yet.

An other way is to use Makefiles or for the fearless ones: fpmake. Or you can create your own build batch file.

Mattias

Reply by email