Thread overview | |||||
---|---|---|---|---|---|
|
December 23, 2010 import from subdir | ||||
---|---|---|---|---|
| ||||
Hello, Say I have a project with the following tree structure: [app] app.d util.d [test] test.d [data] data.d Is there a way to import util & data from test? Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com |
December 23, 2010 Re: import from subdir | ||||
---|---|---|---|---|
| ||||
Posted in reply to spir | On 12/23/2010 1:38 PM, spir wrote:
> Is there a way to import util& data from test?
I think this should work:
util.d first line:
module util;
data.d first line
module data.data;
test.d first lines
module test.test;
import util;
import data.data;
Disclaimer: I don't know if directory names and file names may overlap, maybe you should rename them.
|
December 23, 2010 Re: import from subdir | ||||
---|---|---|---|---|
| ||||
Posted in reply to CrypticMetaphor | On Thursday 23 December 2010 11:30:40 CrypticMetaphor wrote:
> On 12/23/2010 1:38 PM, spir wrote:
> > Is there a way to import util& data from test?
>
> I think this should work:
>
> util.d first line:
> module util;
>
> data.d first line
> module data.data;
>
> test.d first lines
> module test.test;
> import util;
> import data.data;
>
>
> Disclaimer: I don't know if directory names and file names may overlap, maybe you should rename them.
That only works if test/test.d is the module test.test rather than test, and he's trying to compile from the parent directory rather than the test directory.
- Jonathan M Davis
|
Copyright © 1999-2021 by the D Language Foundation