On Sat, Nov 2, 2013 at 12:19 PM, Marcos Douglas <m...@delfire.net> wrote:
> > compiling with > > fpc -ALIAS /lib/* TheLib > > > > won't help, unless you change "ExtraUtils.pas" to use TheLib.StrUtils > > Well, is more common to use just ppu files to not compile these files > every compilation. So, the Lib was already compiled using your own > files, all in the same directory or tree. > The linker has to choose only 1 object file and the wrong file will be taken from the program folder. > > My proposal looks like this: > > -SEARCH > > > > fpc -SEARCH/program/unit1.pas@/lib/ > > > > Causing fpc to look for units at "Libs" first when compiling > > "/program/unit1.pas" > > No changes in any source code necessary. > > With the swicth present > > ---code--- > > unit unit1 > > > > uses StrUtils; // strutils from lib > > ===code=== > > > > thanks, > > Dmitry > > This works only if you don't want use StrUtils of your project and, > IMHO, this is more complex solution. You will need to tell the > compiler which unit of your project that compiles using an unit in > another place that uses the same unit name you already uses in your > project Wrong. The search exception is created for a certain file or files under a certain directory In example above, only /program/unit1.pas would be using StrUtils from "lib" any other file would be using StrUtils from "program". thanks, Dmitry
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal