[fpc-pascal] uses myunit in '../src/myunit.pas' ?

Tim Veldhuizen tim at timveldhuizen.nl
Sat Feb 11 06:04:28 CET 2017


Unit names are considered to be unique, so strictly, for the compiler 
there is no need to specify the path explicitly in code when the unit 
path is given to the compiler when calling it from the command line.

To do this, use the -Fu parameter when calling fpc to include ../src to 
the unit path.

Greetings,
Tim Veldhuizen.

On 11/02/17 04:07, fredvs wrote:
> Hello.
>
> There is myprogram.pas in /home/me/myproject/example.
>
> This program uses myunit.pas from /home/me/myproject/src.
>
> myunit.pas uses myunit2.pas and myunit3.pas that are also in
> home/me/myproject/src.
>
> Using this:
>
> program myprogram;
> ...
> uses myunit in '../src/myunit.pas';
>
> load indeed /home/me/myproject/src/myunit.pas but there are error messages
> because myunit.pas does not find the units that are in uses section.
>
> Here myunit.pas:
>
> unit myunit;
> ...
> uses myunit2, myunit3;
> ...
>
> How to do ?
>
> Thanks.
>
> Fre;D
>
>
>
>
> -----
> Many thanks ;-)
> --
> View this message in context: http://free-pascal-general.1045716.n5.nabble.com/uses-myunit-in-src-myunit-pas-tp5727626.html
> Sent from the Free Pascal - General mailing list archive at Nabble.com.
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal




More information about the fpc-pascal mailing list