On Wednesday, 19 November 2014 at 09:12:52 UTC, Paul wrote:
I would like to create a simple program using SDL. I've read this page http://dblog.aldacron.net/derelict-help/using-derelict/ and this one http://code.dlang.org/about and decided that using 'dub' would be the sensible option for a beginner so I downloaded the dub executable and put it in the same directory as my source file 'test.d'.

As per the example at the above url, I created a dub.json file in the same directory with contents as so:

"dependencies": {
"derelict-sdl2":"~>1.0.0",
"derelict-gl3":"~master",
}

If I have the relevant import statements in test.d, am I right in thinking I can use dub to build my program (not just download and build the derelict libraries)? The command dub build test.d gives me a 'failed to load package' error.

I'm using 32 bit Linux.

Any help appreciated :D

Paul


Dub will download and build the D packages from code.dlang.org.

However, some D packages require you to download compiled
libraries they link to for your syste. (or build them yourself
from source)

For sdl2 on linux, you need to go to:
https://www.libsdl.org/download-2.0.php and download the source.
Compile those libs using ($ ./configure; make; make install;)
Put them into a place your linker can find (usually /usr/lib/
iirc).

I believe that should work for you!

Reply via email to