Can i using D & LLVM & SDL2 for Android?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 13 03:11:35 PDT 2017


On Monday, 13 March 2017 at 06:48:01 UTC, Joakim wrote:

> If you're planning on using Derelict, there is an issue where 
> all Derelict libraries are loaded as shared libraries, whereas 
> the Android port currently doesn't support loading shared 
> libraries.  If DLangUI is using SDL2, maybe he has a header 
> file that allows him to statically link against SDL2, which you 
> could reuse.
>
> Otherwise, you may need to generate one using DStep:
>
> https://github.com/jacob-carlborg/dstep
>
> or modify the DerelictSDL2 files to allow you to link 
> statically.

The alpha release of DerelictSDL2 3.0 supports static linking.

When compiling manually, it requires -version=DerelictSDL_static 
on the command line and all files matching 
"derelict/sdl2/internal/*_dyn*.d" should be excluded from the 
build.

When building DerelictSDL2 with DUB, specifying 
-cderelict-sdl2-static gets the job done, or the same can be 
added as a subConfiguration value in a project's dub.json/sdl 
file.


More information about the Digitalmars-d-learn mailing list