About modules
Damian
damian.pop at gmail.com
Mon Jul 24 16:00:05 PDT 2006
Perfect! Thanks!
Anyone knows how can I set the import path root using gdc? It has no
sc.ini file.
On Tue, 25 Jul 2006 10:33:28 +1200, Regan Heath wrote:
> On Mon, 24 Jul 2006 17:18:27 -0300, Damian <damian.pop at gmail.com> wrote:
>> I'm with gdc on linux, And think I dont understand how
>> files/packages/modules works.
>> I am organizing files in folders like this:
>>
>> /main/something/moda.d
>> /main/gui/modb.d
>>
>> in modb.d: Can I import moda?
>> I get "module modb cannot read file..."
>>
>> Thanks and sorry for my strange english!
>
> If you tell DMD that your import path is the 'root' the one which contains
> 'main' then in /main/something/moda.d you could write "import
> main.gui.modb;". Likewise, in /main/gui/modb.d you would write "import
> main.something.moda;".
>
> The import package/module/file is relative to the import path root(s). The
> file sc.ini in dmd/bin/ tells it where the import path root(s) are, eg:
>
> DFLAGS="-I%@P%\..\src\phobos;%@P%\..\..\src"
>
> The -I is for import paths, note that I have added %@P%\..\..\src (I'm on
> windows), this is my import path root for most of my D source code. %@P%
> resolves to the dmd/bin directory.
>
> Regan
More information about the Digitalmars-d-learn
mailing list