On Tue, 4 Jul 2006 15:59:45 +0200
"Graeme Geldenhuys" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I often get SVN updates for Lazarus (currently on rev.9554). I also
> use the lastest FPC 2.0.x from SVN.
>
> I use Packages a lot, but for the last week or so, Lazarus can't seem
> to find my source for the used units in my projects. This results in
> code completion not working, though I can compile my projects (so it
> does find the compiled units of the package). Is anybody else
> experiencing this. I am using Lazarus under Ubuntu Linux, compiled
> with GTK1.
>
> Here is a simple example I am busy with, that doesn't work.
>
> Directory layout;
>
> /project/
> /src
> /examples
>
> Inside /src I have a single fpGui.pas file that contains a lot of {$I
> ...} lines. I created a packages for it and saved the package in the
> /src directory. I opened the Package, clicked Options and entered the
> following in the Unit path.
>
> $(PkgOutDir)/
> /home/graemeg/programming/fpgui/src/
You almost never need to add a unit path yourself.
Add instead one of the units of each directory to the owner (package or
project). For example add a unit of 'src' to the package. Add a unit of
'examples' to the project. Of course the package directory (.lpk) is always
part of the package. And the project directory (.lpi) is always part of the
project.
This way the IDE knows, which search paths should be applied to each
directory: The package search paths to the 'src' directory and the project
search paths to the 'examples'.
> Clicked Save and then Compile and closed the Package dialog. Now I
> created a new project in /examples and saved the project. Went into
> Project Inspector and added the fpGUI package as a Requirement. In
> Compiler Options -> Inherited I can see both paths correctly (relative
> to my project).
>
> Now I start using the classes in my example project. When I Ctrl-Click
> on a class I know is defined in the Package, Lazarus jumps to the uses
> clause as says "Error: unit not found: fpGui". As I mentioned
> earlier, as long as I don't try to use Code Completion or Ctrl-Click,
> everything works fine and I can compile my project.
>
> I even tried to include the ../src/ path in the example projects
> "Compiler Options" -> "Other Unit Files" and "Other Sources" and still
> code completion doesn't work.
>
> As I said, I have used the above process for months now and it always
> worked. Now suddenly it doesn't... what has changed?
You can see all search paths in Unit Info (Src Editor -> Popup Menu -> Unit
Info). Open the tab 'Source Paths'. These paths are used to search for
.pas/.pp/.p files. What do you see for examples/unit1.pas?
Mattias
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives