mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (


From: Schrober
Subject: Re: [Mingw-cross-env-list] Fails to call SDL_InitSubSystem from plugin (Was: State of SDL2 in MXE)
Date: Tue, 25 Jun 2013 14:18 +0200
User-agent: KMail/4.10.4 (Linux/3.9-1-amd64; KDE/4.10.4; x86_64; ; )

On Tuesday 25 June 2013 14:04:02 Martin Gerhardy wrote:
> Am 25.06.2013 13:38, schrieb Schrober:
> > On Tuesday 25 June 2013 12:58:57 Schrober wrote:
> >> Just as info for the developers: This regression was introduced in rev
> >> cd5516b9263d - reverting it fixes the problem for me. Attached are both
> >> files
> > 
> > Here is the output of some debug patch (attached) on MXE (windows):
> > 
> > DDDDDDDDDDDDDDDDDDDDDDebug checking if MainIsReady(1) 004C8720
> > DDDDDDDDDDDDDDDDDDDDDDebug checking if MainIsReady(1) 004C8720
> > DDDDDDDDDDDDDDDDDDDDDDebug checking if MainIsReady(0) 652C99A0
> > 
> > The first two are from the main program and the last one is from the
> > plugin
> > loaded by the main program. And on linux it looks like:
> > 
> > DDDDDDDDDDDDDDDDDDDDDDebug checking if MainIsReady(1) 0x7f7815241008
> > DDDDDDDDDDDDDDDDDDDDDDebug checking if MainIsReady(1) 0x7f7815241008
> > DDDDDDDDDDDDDDDDDDDDDDebug checking if MainIsReady(1) 0x7f7815241008
> 
> as MXE is linking statically, you are loading sdl twice - once the
> statically linked sdl of your main program, and once the dll. I suppose
> the linux build was linked dynamically, and not statically. If you would
> link SDL statically to your main program, you should also get the same
> error on linux.
> 
> A possible solution here would e.g. be to only give function pointers to
> your plugin dll and not linking the dll to SDL at all. I'm of course not
> sure whether that would work in your particular use case. But linking
> two times and relying on a shared state might lead to a lot more
> trouble. The SDL_MainIsReady is only the first visible thing.

Yes, this was what I assume. Giving functions pointers around is not possible. 
But it seems to be ok to modify mxe to make shared objects. And btw. I ran in 
the next problem when I tried to create an SDL window from a plugin (endless 
recursion which trashed the stack).
-- 
Franz Schrober



reply via email to

[Prev in Thread] Current Thread [Next in Thread]