Unit path search order

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Unit path search order

Martin Schreiber-2
Hi,
http://www.freepascal.org/docs-html/current/user/usersu7.html#x21-280003.1.2
states:
"
You can add a directory to the unit search path with the (-Fu (see page 100))
option. Every occurrence of one of these options will insert a directory to
the unit search path. i.e. the last path on the command line will be searched
first.
"
Does this still apply? My experiments seem to indicate that the first path on
commandline is searched first.

Martin
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unit path search order

Jonas Maebe-2
Martin Schreiber wrote:

> http://www.freepascal.org/docs-html/current/user/usersu7.html#x21-280003.1.2
> states:
> "
> You can add a directory to the unit search path with the (-Fu (see page 100))
> option. Every occurrence of one of these options will insert a directory to
> the unit search path. i.e. the last path on the command line will be searched
> first.
> "
> Does this still apply?

 From looking at the compiler code: yes.


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unit path search order

Martin Schreiber-2
On Saturday 23 April 2016 10:40:58 Jonas Maebe wrote:

> Martin Schreiber wrote:
> > http://www.freepascal.org/docs-html/current/user/usersu7.html#x21-280003.
> >1.2 states:
> > "
> > You can add a directory to the unit search path with the (-Fu (see page
> > 100)) option. Every occurrence of one of these options will insert a
> > directory to the unit search path. i.e. the last path on the command line
> > will be searched first.
> > "
> > Does this still apply?
>
>  From looking at the compiler code: yes.
>
I made a test.

in ./:
"
program conssoletest;
uses
 testunit;
begin
 testunit0();
end.
"

in ./test:
"
unit testunit;
interface
procedure testunit0();
implementation
procedure testunit0();
begin
end;
end.
"

in ./test1:
"
unit testunit;
interface
procedure testunit1();
implementation
procedure testunit1();
begin
end;
end.
"

"
mse@linuxmse:~/proj/consoletest> fpc -oconssoletest -Fu./test -Fu./test1
conssoletest.pas
Free Pascal Compiler version 3.0.0rc2 [2015/10/14] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling conssoletest.pas
Compiling ./test/testunit.pas
Linking conssoletest
/usr/bin/ld: warning: link.res contains output sections; did you forget -T?
14 lines compiled, 0.2 sec
"

"
mse@linuxmse:~/proj/consoletest> fpc -oconssoletest -Fu./test1 -Fu./test
conssoletest.pas
Free Pascal Compiler version 3.0.0rc2 [2015/10/14] for i386
Copyright (c) 1993-2015 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling conssoletest.pas
Compiling ./test1/testunit.pas
conssoletest.pas(5,2) Error: Identifier not found "testunit0"
conssoletest.pas(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode
"

Martin
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Unit path search order

Martin Schreiber-2
On Saturday 23 April 2016 11:18:48 Martin Schreiber wrote:

> On Saturday 23 April 2016 10:40:58 Jonas Maebe wrote:
> > Martin Schreiber wrote:
> > > http://www.freepascal.org/docs-html/current/user/usersu7.html#x21-28000
> > >3. 1.2 states:
> > > "
> > > You can add a directory to the unit search path with the (-Fu (see page
> > > 100)) option. Every occurrence of one of these options will insert a
> > > directory to the unit search path. i.e. the last path on the command
> > > line will be searched first.
> > > "
> > > Does this still apply?
> >
> >  From looking at the compiler code: yes.
>
> I made a test.
>
[...]
Bugreport is here:
http://bugs.freepascal.org/view.php?id=30053

Martin
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal