ste3e
ste3e

Reputation: 1035

How do you set up Derelict 3 on DMD 2?

Most of the material out there is DMD1 with Derelict2. I have tried everything I can think of and all I get is different sorts of rubbish. DMD2 is installed OK because I can compile hello worlds. My sc.ini reads:

[Version]
version=7.51 Build 020

[Environment]
LIB="%@P%\..\lib";\dm\lib
DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import" "-I%@P%\..\..\src\etc"
LINKCMD=%@P%\link.exe

If the path to gl3.d is not included (I am using Eclipse and also checking things out with dmd/bud from the the command shell, Windows XP) I get "cannot read gl3.d" error, which is fixed when the path is added to the Library references.

The file I am trying to compile is:

import std.stdio;
import derelict.opengl3.gl3;

pragma(lib, "DerelictGL3.lib");

void main(){
    DerelictGL3.load();


    writeln("Fred");

}

If I comment out the pragma the error is:

OPTLINK (R) for Win32  Release 8.00.12
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
bin\Main.obj(Main) 
 Error 42: Symbol Undefined _D8derelict7opengl33gl312__ModuleInfoZ
bin\Main.obj(Main) 
 Error 42: Symbol Undefined _D8derelict7opengl33gl311DerelictGL3C8derelict7opengl33gl317DerelictGL3Loader
--- errorlevel 2

If I uncomment the pragma the error is:

--------  Build Commands:  --------
-od"bin"
-of"bin\Main.exe"

-I"src"

"src\Main.d"



OPTLINK (R) for Win32  Release 8.00.12
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
D:\Programming\DMD\dmd2\windows\bin\..\lib\DerelictGL3.lib(gl3) 
 Error 42: Symbol Undefined _D8derelict4util6loader15SharedLibLoader19isAutoUnloadEnabledOFNdZb
D:\Programming\DMD\dmd2\windows\bin\..\lib\DerelictGL3.lib(gl3) 
 Error 42: Symbol Undefined _D8derelict4util9exception17DerelictException7__ClassZ
D:\Programming\DMD\dmd2\windows\bin\..\lib\DerelictGL3.lib(gl3) 

and it keeps going in the same vein until I suppose every function has been listed.

Please help.

Upvotes: 1

Views: 1071

Answers (1)

dav1d
dav1d

Reputation: 6055

You have to add a pragma(lib, "DerelictUtil.lib"), or link against it. (That's the same with Derelict2)

Upvotes: 5

Related Questions