Re: [ooc-compiler] Search path inconsistent?
Brought to you by:
mva
|
From: Stewart G. <sgr...@us...> - 2007-10-23 00:20:01
|
Hi Henk,
The normal way to build a module is to name the module, not the file.
Try doing:
oo2c -M Two
That should also compile all of the modules on which Two depends. The
compiler expects all source code to be in repositories. By default, the
current directory is included so the compiler will look in "src" for
source files.
Cheers,
Stewart
Henk Koster wrote:
> Hi,
>
> I'm using OO2C version 2.11 on Debian Gnu/Linux (Sid) and have encountered an
> inconsistency in the way the compiler searches for source files when in some
> local working directory (not any of the named repositories in oo2crc.xml).
> I've also found a work-around, although I hesitate posting it here since I
> don't have a Ph.D. in Computer Science... If readers find this message
> superfluous or uninformed they should just ignore it.
>
> Suppose I have source files One.Mod and Two.Mod, both placed in the src/
> sub-directory of some current working directory (CWD), with Two.Mod importing
> One.Mod. While in the CWD, when I compile
>
> $ oo2c -M Two.Mod
>
> the compiler finds src/Two.Mod but does not find src/One.Mod, apparently
> because it is looking for src/src/One.Mod.
>
> After some experimenting I've found the following work-around: put local
> source files (One.Mod and Two.Mod in the example) in the "top-level" CWD, and
> make src a symlink to it,
>
> $ ln -s $PWD src
>
> Now the compiler finds both source files, and will do so in general at any
> level of nested imported files. The compiler will create sym/, obj/ and bin/
> sub-directories, if necessary.
>
> The above symlink trick is not needed for any of the named repositories, only
> for the default CWD (".") repositories.
>
> Actually, I prefer having source files in a "top level" working directory
> rather than in a src/ sub-directory, so I'm not complaining about the
> work-around.
>
|