www.digitalmars.com         C & C++   DMDScript  

D - import std conflict

reply Ant <Ant_member pathlink.com> writes:
when compiling with dmd 0.75, linux, command line:
dmd -release <<<many files.d>>> -c -I~/dmd/src/phobos:src -od../obj/ -op

I get:
def/Types.d(17): import std conflicts with DUI.std at dui/DUI.d(19)

<defTypes.d line 17> private import std.path;

<dui/DUI.d line 19> private import std.thread; 

BTW the linux dir was under std.
I moved mine to under std/c - seems to do be working.

Ant
Nov 05 2003
next sibling parent reply "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
Same stuff happens on Windows and it's kinda annoying...

Lars Ivar Igesund

"Ant" <Ant_member pathlink.com> wrote in message
news:bocn88$24rj$1 digitaldaemon.com...
 when compiling with dmd 0.75, linux, command line:
 dmd -release <<<many files.d>>> -c -I~/dmd/src/phobos:src -od../obj/ -op

 I get:
 def/Types.d(17): import std conflicts with DUI.std at dui/DUI.d(19)

 <defTypes.d line 17> private import std.path;

 <dui/DUI.d line 19> private import std.thread;

 BTW the linux dir was under std.
 I moved mine to under std/c - seems to do be working.

 Ant
Nov 06 2003
parent Ant <Ant_member pathlink.com> writes:
In article <bod2l1$2mi7$1 digitaldaemon.com>, Lars Ivar Igesund says...
Same stuff happens on Windows and it's kinda annoying...

"Ant" <Ant_member pathlink.com> wrote in message
 def/Types.d(17): import std conflicts with DUI.std at dui/DUI.d(19)
I guess one of us will have to create a small example with two empty source files and post a "BUG:" message. I'll try to do it tonight unless I see you did it already. Ant
Nov 06 2003
prev sibling parent reply "Lars Ivar Igesund" <larsivi stud.ntnu.no> writes:
I found the problem. I don't think it's a bug. Instead it's quite simple...
In the DUI case, the problem is that very many files do
private import def.Types;
The problematic files are those that also import ObjectG.d (all of them?).
The reason is that ObjectG.d do this:
import def.Types;
This means that files that import both ObjectG.d and Types.d, actually
imports Types.d twice and voila, a conflict. Just remove
private import def.Types from all files that also do
import dui.ObjectG;

The error message is still horrible, of course as it says nothing about
the really offending file (unless you compile one and one object with
the -c switch which again leads to the forward referencing bug (still
standing))

Lars Ivar Igesund


"Ant" <Ant_member pathlink.com> wrote in message
news:bocn88$24rj$1 digitaldaemon.com...
 when compiling with dmd 0.75, linux, command line:
 dmd -release <<<many files.d>>> -c -I~/dmd/src/phobos:src -od../obj/ -op

 I get:
 def/Types.d(17): import std conflicts with DUI.std at dui/DUI.d(19)

 <defTypes.d line 17> private import std.path;

 <dui/DUI.d line 19> private import std.thread;

 BTW the linux dir was under std.
 I moved mine to under std/c - seems to do be working.

 Ant
Nov 12 2003
parent Ant <Ant_member pathlink.com> writes:
In article <bot5do$22lu$1 digitaldaemon.com>, Lars Ivar Igesund says...
I found the problem. I don't think it's a bug. Instead it's quite simple...
In the DUI case, the problem is that very many files do
private import def.Types;
The problematic files are those that also import ObjectG.d (all of them?).
The reason is that ObjectG.d do this:
import def.Types;
This means that files that import both ObjectG.d and Types.d, actually
imports Types.d twice and voila, a conflict. Just remove
private import def.Types from all files that also do
import dui.ObjectG;
I'll check that also (see my answer to Walter http://www.digitalmars.com/drn-bin/wwwnews?D/19186)! but... I changed ALL imports to private when trying to figure this out and still have problems with import. thanks Ant
Nov 12 2003