Sign in Join

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

Mailing lists / fpc-pascal / 2016-04

Unit path search order

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Martin Schreiber
to Jonas Maebe
Jonas Maebe wrote 13 lines
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.
"

"

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
"

"

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

Reply by email

Martin Schreiber
to Martin Schreiber
Martin Schreiber wrote 16 lines
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

Reply by email