How to load a derelict program in D?

Kelet kelethunter at gmail.com
Fri Dec 6 15:35:34 PST 2013


On Friday, 6 December 2013 at 19:50:52 UTC, Jeroen Bollen wrote:
> I am using the derelict-sfml2 package in my code. My code:
>
> import std.stdio;
> import derelict.sfml2.window;
>
> void main()
> {
> 	DerelictSFML2Window.load();
> 	sfVideoMode videoMode = sfVideoMode(1280, 720);
> 	sfWindow* window = sfWindow_create(videoMode, "Animation", 
> sfNone, null);
> }
>
> For some reason this always crashes inside a "void load( string 
> libNames )" function. The crash seems to happen inside the 
> 'DerelictSFML2Window.load();'.
>
> Why is that? I am using Visual Studio 2013, with the VisualD 
> add-on. I have created the solution using "dub generate 
> visuald"; this is my project.json:
>
>
> {
> 	"name": "testing",
> 	"description": "testing",
> 	"authors": ["Jeroen Bollen"],
> 	"dependencies": {
> 		"derelict-sfml2" : "~master",
> 	}
> }

Hello. I've used your package.json and source code in an attempt
to replicate the problem, but could not. In this case, I'll still
offer some "brute force" advice:

1. Ensure that CSFML >=2.0 dynamic libraries are in your PATH.
Version 2.1 is working for me.

2. Make sure that the CSFML dynamic libraries are for the right
architecture. I'm using the 32-bit Visual C++/GCC binaries
(http://www.sfml-dev.org/download/csfml/CSFML-2.1-windows-32bits.zip).

3. Remove %APPDATA%\dub to get rid of possibly old packages and
make sure your Dub is the latest version.

4. Try running it via dub rather than VisualD. i.e., "dub run" or
"dub run --compiler=ldc2", etc.


More information about the Digitalmars-d-learn mailing list