Derelict SDL2 library not loading on OS X

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 18 05:16:13 PST 2014


On 12/18/2014 3:29 PM, Joel wrote:
> I've installed SDL2.
>
> Joels-MacBook-Pro:DerelictTest joelcnz$ cat test.d
>
> import derelict.sdl2.sdl;
>
> int main() {
>      DerelictSDL2.load();
> }
>
>
> Joels-MacBook-Pro:DerelictTest joelcnz$ dmd test libDerelictSDL2.a
> libDerelictUtil.a
> Joels-MacBook-Pro:DerelictTest joelcnz$ ./test
> derelict.util.exception.SharedLibLoadException at source/derelict/util/exception.d(35):
> Failed to load one or more shared libraries:

After that last colon, you should be seeing a list of library names that 
failed to load. Did you somehow fail to copy/paste it or is it really 
missing?

You can see the names that Derelict searches for by default on Mac at 
[1]. Make sure that your copy of SDL is installed at one of those 
locations. Otherwise, you can pass the path to your installed copy to an 
overload of the load method:

DerelictSDL2.load( ["Path/to/your/SDL2/installation.framework/dylib"] );

[1] 
https://github.com/DerelictOrg/DerelictSDL2/blob/master/source/derelict/sdl2/sdl.d#L42 




More information about the Digitalmars-d-learn mailing list