FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

import conflicts (sdl and gl)

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Nov 17, 2004 8:45 pm    Post subject: import conflicts (sdl and gl) Reply with quote

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
View user's profile Send private message AIM Address
jcc7



Joined: 22 Feb 2004
Posts: 654
Location: Edmond, OK, USA

PostPosted: Wed Nov 17, 2004 11:32 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Thu Nov 18, 2004 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu Nov 18, 2004 9:39 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
jcc7



Joined: 22 Feb 2004
Posts: 654
Location: Edmond, OK, USA

PostPosted: Thu Nov 18, 2004 11:19 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address
randomZ



Joined: 04 Dec 2004
Posts: 31
Location: Tuebingen, Germany

PostPosted: Sat Dec 04, 2004 11:30 am    Post subject: Reply with quote

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
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 654
Location: Edmond, OK, USA

PostPosted: Sat Dec 04, 2004 12:05 pm    Post subject: Reply with quote

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. Wink
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group