View previous topic :: View next topic |
Author |
Message |
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Wed Nov 17, 2004 8:45 pm Post subject: import conflicts (sdl and gl) |
|
|
hello I've been trying to compile my project with dmake and I've come across a strange error
Code: |
derelict/sdl/sdl.d(25): import derelict.sdl.sdl.std conflicts with derelict.opengl.gl.std at derelict/opengl/gl.d(27)
|
sdl(25) and gl(27) share the same line
Code: |
private import std.loader;
|
If anyone could offer help/advice I'd very much appreciate it. Thanks. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Wed Nov 17, 2004 11:32 pm Post subject: |
|
|
I haven't looked at your code, but the error message reminds me of this problem that I ran into: digitalmars.D.bugs/1307.
Walter replied with a simple explanation for what I needed to do to get it to work right (digitalmars.D.bugs/1313). Then, I responded with further analysis of the situation and a suggestion to at least improve the error message.
The tricky part for me was finding which file didn't show up in the error message. That was where I needed to add an import statement. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Thu Nov 18, 2004 8:09 am Post subject: |
|
|
That's really annoying. If it's a private import then why would it cause conflicts elsewhere? I hope this is classified as a D bug and not a feature. Are you perchance publicly importing std.loader in any files prior to importing the Derelict stuff? |
|
Back to top |
|
|
clayasaurus
Joined: 21 May 2004 Posts: 857
|
Posted: Thu Nov 18, 2004 9:39 am Post subject: |
|
|
aldacron wrote: | Are you perchance publicly importing std.loader in any files prior to importing the Derelict stuff? |
lol. that's actually what i just did to get it to compile : )
Thanks to jcc7 i rediscovered those old bug reports, and walters response was akin to do something like the following...
Code: |
[main.d] // this gave me the conflict error
import derelict.sdl.sdl;
import dereclict.opengl.gl; |
Code: |
[main.d] // this fixed the conflict error
import std.loader;
import derelict.sdl.sdl;
import dereclict.opengl.gl; |
|
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Thu Nov 18, 2004 11:19 am Post subject: |
|
|
aldacron wrote: | I hope this is classified as a D bug and not a feature. | Walter never replied to my last diatribe about this in the bugs newsgroup, but I think it works according to his design. But, at the minimum, the error message need to give better information about which file needs to be changed.
In my experience, the error message only identifies the 2 files with the conflict, but actually a third file needs the additional import statement. Finding the third file was the tricky part for me (my newsgroup post watered down the complexity to illustrate the problem).
It's possible that Walter doesn't understand my concerns, but I suspect he has bigger fish to fry right now. |
|
Back to top |
|
|
randomZ
Joined: 04 Dec 2004 Posts: 31 Location: Tuebingen, Germany
|
Posted: Sat Dec 04, 2004 11:30 am Post subject: |
|
|
From my experience, you can usually see the conflicting file by looking at the compile command (assuming you only build one source file at a time).
The conflicting source file is usually the one that is currently being compiled. An import of the module the compiler complained about should be added there. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Sat Dec 04, 2004 12:05 pm Post subject: |
|
|
randomZ wrote: | From my experience, you can usually see the conflicting file by looking at the compile command (assuming you only build one source file at a time).
The conflicting source file is usually the one that is currently being compiled. An import of the module the compiler complained about should be added there. | Thanks for the tip. It sounds like a good one. I'll try that next time I run into the problem. I often try to compile a bunch of files all at the same time, but I'll happily compile them separately if it helps my find where this problem occurs.
I still think it shouldn't be too hard for the compiler to report this information, though. |
|
Back to top |
|
|
|