Sign in Join

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

Mailing lists / lazarus / 2008-05

CodeTools doesn't look in the project's search path

14 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

Tobias Giesen

Hello,

two questions: do I really need to copy the project's search paths into the separate CodeTools dialog so that my units are found?

Or is this something I could try to implement, making CodeTools aware of the project's search paths?

Cheers,
Tobias

Reply by email

Graeme Geldenhuys
to Tobias Giesen

If the units are part of your project or part of a Package which is a requirement of your project, CodeTools will automatically find those units.

Graeme.

2008/5/28 Tobias Giesen :

Show quoted text 11 lines
Hello, two questions: do I really need to copy the project's search paths into the separate CodeTools dialog so that my units are found? Or is this something I could try to implement, making CodeTools aware of the project's search paths? Cheers, Tobias

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Tobias Giesen
to Graeme Geldenhuys: If the units are part of your project or part of a Package which is a requirement of your…
If the units are part of your project or part of a Package which is a requirement of your project, CodeTools will automatically find those units.

I see, but that is not enough for me. I need the whole Project's search path to be searched. Otherwise I would have to add about 300 units to my project. I don't want to do that ...

Is this an option I could add? I mean would it be accepted?

Cheers,
Tobias

Reply by email

Vincent Snijders
to Tobias Giesen
Tobias Giesen wrote 8 lines
> If the units are part of your project or part of a Package which is a > requirement of your project, CodeTools will automatically find those > units. I see, but that is not enough for me. I need the whole Project's search path to be searched. Otherwise I would have to add about 300 units to my project. I don't want to do that ...

Why not? The units are problably already in the lpi, because you edited them once. The project inspector has a multiselect add files dialog, so adding them would not be a lot of work.

Vincent

Reply by email

Graeme Geldenhuys
to Tobias Giesen: I see, but that is not enough for me. I need the whole Project's search path to be…

2008/5/28 Tobias Giesen :

Show quoted text 7 lines
> If the units are part of your project or part of a Package which is a > requirement of your project, CodeTools will automatically find those > units. I see, but that is not enough for me. I need the whole Project's search path to be searched. Otherwise I would have to add about 300 units to my project. I don't want to do that ...

It's not good practice to indirectly use units (not part of you project). Otherwise, how would the compiler know if that unit had changed since the previous compile. If they are part of the project (which they should be), the compiler or Lazarus can detect changes.

If you use a Package, you can use the "Add Files" tab to add all *.pas units in one go.

Is this an option I could add? I mean would it be accepted?

As Mattias said, you can also add unit paths in your project's compiler options dialog (Project | Compiler options | Paths tab).

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Tobias Giesen
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…
Probably you forgot to add the unit to the project.

I don't want to add all units to the project. Why can't CodeTools just search the complete project's search path? They do not do it.

I am using a lot of third party code libraries but I construct the components at run time, so I don't see any need to add them to a package. Why should I do that?

Cheers,
Tobias

Reply by email

Tobias Giesen
to Graeme Geldenhuys: 2008/5/28 Tobias Giesen : It's not good practice to indirectly use units (not part of you…
It's not good practice to indirectly use units (not part of you project). Otherwise, how would the compiler know if that unit had changed since the previous compile.

That's actually not true. The FPC checks and finds all units and compares their checksums and determines if a recompile is needed. There is absolutely no need to add them to the project.

As Mattias said, you can also add unit paths in your project's compiler options dialog (Project | Compiler options | Paths tab).

Yes, I have done that, and the project compiles fine. But CodeTools ignores that setting, so it does not find some of my files.

Kind Regards,
Tobias Giesen

Super Flexible Software Ltd. & Co. KG
Lessingstr. 42
48485 Neuenkirchen, Germany
www.superflexible.com
www.tgtools.com

----------------------------------------------------------- Registered at register court Steinfurt as HRA 5061 Liability / general partner: TGTools Ltd.
Company No. 05513299
Registered in England and Wales
Directors: Tobias Giesen and Claudia H?bl

Reply by email

Tobias Giesen
to Mattias Gärtner
Which unit A does not find which other unit B?

OK I am in the editor and working on unit
/code07/SuperFlexibleSynchronizer/SyncKernel/SyncMainFormBase.pas

The "Unit Paths" field in File Settings is totally empty. What should I find there?

I am clicking on a symbol and then the cursor jumps to the unit name TGIniFiles in the uses clause and it says: unit not found: TGIniFiles

TGIniFiles is actually /code07/Units/TGIniFiles.pas

/code07/Units/ is in the Project's compiler search path.

When I add /code07/Units/ to Environment->CodeTools options, then it works.

Hitting Ctrl+Enter on the TGIniFiles unit name behaves the same.

If it's a bug I can go looking for it. I think that the directorycacher doesn't get the full search path.

Cheers,
Tobias

Reply by email

Tobias Giesen
to Mattias Gärtner: An embedded and charset-unspecified text was scrubbed... Name: not available Url:…

Hi,

OK when I add the unit to the Project, it works much better.

I don't have to add all units that need to be found by CodeTools, I just need to add the units in which I work and from which I look for symbols.

But still, if CodeTools could just use the main Project path even if it doesn't know that the file is part of the project, that would be nice.

Cheers,
Tobias

Reply by email

Tobias Giesen
to Mattias Gärtner
You probably forgot to add /code07/SuperFlexibleSynchronizer/SyncKernel/ to the project's search path.

No, the search path is correct. But well I understand things better now and maybe I can find the cause myself now.

Thanks for all the help!

Lazarus is truly fascinating!

Cheers,
Tobias

Reply by email