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

Build on Linux - derelict SDL and symbol already defined

 
Post new topic   Reply to topic     Forum Index -> Yage
View previous topic :: View next topic  
Author Message
rti



Joined: 06 Feb 2007
Posts: 3

PostPosted: Tue Feb 06, 2007 8:28 pm    Post subject: Build on Linux - derelict SDL and symbol already defined Reply with quote

Hello.

I checked out the current svn (r19) and tried to compile the code on linux using bud. The first problem i ran into was in derelict/sdl/syswm.d.

I got the following error:
Code:
derelict/sdl/syswm.d:73: struct derelict.sdl.syswm.SDL_SysWMinfo conflicts with derelict.sdl.syswm.SDL_SysWMinfo at derelict/sdl/syswm.d:67


I changed:
Code:
version(linux)
{
    struct SDL_SysWMmsg;
    struct SDL_SysWMinfo;
}

version(Unix)
{
    struct SDL_SysWMmsg;
    struct SDL_SysWMinfo;
}

to:
Code:
version(linux)
{
    struct SDL_SysWMmsg;
    struct SDL_SysWMinfo;
}

// version(Unix)
// {
//     struct SDL_SysWMmsg;
//     struct SDL_SysWMinfo;
// }

This did the trick. Smile

For the second problem i do not have a solution.
Code:
/tmp/ccUO20f8.s: Assembler messages:
/tmp/ccUO20f8.s:1015: Error: symbol `_D4yage6system6device6Device10getSupportFiZb1si' is already defined
/tmp/ccUO20f8.s:1021: Error: symbol `_D4yage6system6device6Device10getSupportFiZb1si' is already defined

Greping through the whole source gave me just one definition of getSupport(). So I am kinda lost here.

I am running: gdc (GCC) 4.0.3 (gdc 0.21, using dmd 1.00)

Any suggestions welcome Razz
Bye, rti
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Wed Feb 07, 2007 12:44 am    Post subject: Re: Build on Linux - derelict SDL and symbol already defined Reply with quote

rti wrote:
Hello.

I checked out the current svn (r19) and tried to compile the code on linux using bud. The first problem i ran into was in derelict/sdl/syswm.d.

I got the following error:
Code:
derelict/sdl/syswm.d:73: struct derelict.sdl.syswm.SDL_SysWMinfo conflicts with derelict.sdl.syswm.SDL_SysWMinfo at derelict/sdl/syswm.d:67


I changed:
Code:
version(linux)
{
    struct SDL_SysWMmsg;
    struct SDL_SysWMinfo;
}

version(Unix)
{
    struct SDL_SysWMmsg;
    struct SDL_SysWMinfo;
}

to:
Code:
version(linux)
{
    struct SDL_SysWMmsg;
    struct SDL_SysWMinfo;
}

// version(Unix)
// {
//     struct SDL_SysWMmsg;
//     struct SDL_SysWMinfo;
// }

This did the trick. Smile

This because dmd defines version(linux) and Bud, seeing this also defines version(Unix). In other words, linux and Unix are the same things in Bud's eyes.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
rti



Joined: 06 Feb 2007
Posts: 3

PostPosted: Wed Feb 07, 2007 7:11 am    Post subject: Reply with quote

Is there a way to combine those version statements? like:
Code:
version(linux || unix)
{
  // foo
}
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Wed Feb 07, 2007 10:37 am    Post subject: Reply with quote

I'd never tried compiling yage via gdc, but I plan to make it work eventually. I'm not the best at resolving linking errors, and I don't know why gdc has trouble with that particular function. There's nothing that sets it apart from any of the others. Anyone else have ideas?

In the meantime, you should be able to use dmd on linux as a workaround.
Back to top
View user's profile Send private message
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Wed Feb 07, 2007 2:03 pm    Post subject: Reply with quote

rti wrote:
Is there a way to combine those version statements? like:
Code:
version(linux || unix)
{
  // foo
}

Why would you want to? They are the same thing. It like coding ...

const int ZERO = 0;

if (foo == 0 || foo == ZERO)
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
rti



Joined: 06 Feb 2007
Posts: 3

PostPosted: Thu Feb 08, 2007 5:38 am    Post subject: Reply with quote

Quote:
Why would you want to? They are the same thing.

No, unix != linux.

Anyway. I think i will give dmd a try then.

Thanks for your answers.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Thu Feb 08, 2007 3:34 pm    Post subject: Reply with quote

You could also try removing that function and replace all calls to it with false, at the expense of better performance on higher end cards, but dmd`s probably the better option for now.
Back to top
View user's profile Send private message
aldacron



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

PostPosted: Thu Feb 08, 2007 7:09 pm    Post subject: Reply with quote

Actually, the DerelictSDL issue was fixed in Derelict a couple of weeks ago. Update to the latest trunk and all should be well.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Fri Feb 09, 2007 4:36 pm    Post subject: Reply with quote

Yage with the latest Derelict is now in the trunk.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Fri Feb 23, 2007 10:12 pm    Post subject: Reply with quote

I just tried building yage on windows via gdc and I also get the same linking error--it makes no sense.
Back to top
View user's profile Send private message
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Tue Apr 10, 2007 6:35 pm    Post subject: Reply with quote

The gdc linking error was fixed in the latest commit. In Device.getSupport(), I was redeclaring a static variable with the same name multiple times inside different scopes. Dmd didn't have a problem with it but GDC did. I refactored and it worked. There's now some basic but buggy GDC support in buildme.d.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Yage 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