You are not logged in.

#1 2011-12-12 20:36:02

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

[SOLVED] Compiling a Derelict program

Hey guys,
I've spent hours trying to do this with no success, so I'm here now.

I'm trying to compile this (link) program to test my derelict installation with no success.

I've been trying with multiple command lines and different DMD2 (and GDC) packages from the AUR.
I also tried installing derelict by either DSSS or from AUR. But the DSSS path was unsuccessful:
it was lying about packages already existing and just exited, not to mention many errors popping up.

One command line option is:

gdc -I/usr/include/d2/ -L -ldl -L -lDerelictGL -L -lDerelictGLUL -L -lDerelictSDL -L -lDerelictUtil *.d -ofexample

and another:

dmd2 -I/usr/include/d2 main

The first one throws a plethora of linker errors (I don't know what all the -L's are,
but it's the same with or without them), while the second one says:

/usr/include/d2/derelict/opengl/glx.di(36): use of typedef is deprecated; use alias instead

for several different lines and produces no output file (even if I use -of<name>).

Thank you!

EDIT: SOLUTION is on StackOverflow. I don't know why it didn't work, actually. But it does now. With DMD.
Here's the link: click.

Last edited by Nanthiel (2011-12-17 10:49:54)

Offline

#2 2011-12-12 23:16:56

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] Compiling a Derelict program

I just installed derelict2-svn r593 with the AUR package (had to remove d2_config-hg from the dependencies.)
I already had dmd2-git 20111021 and dsss 0.78-2 (not sure where I got the package from; it's not in the official repos nor in AUR anymore.)
I'm getting:

$ dmd -I/usr/include/d2 main.d 
std.intrinsic has been moved. Please import core.bitop instead.
main.d(43): Error: cannot implicitly convert expression (code.length) of type ulong to int

I suppose the first message is caused by derelict2. Doesn't look like it needs fixing right now though.

I'm not sure what the error message implies... It can probably be fixed with a cast(int) but I don't know why the original coder didn't get the error since it seems he also used dmd2.

I'll see if I can make it work...

Edit: Ok, try:

dmd -I/usr/include/d2 -L-lDerelictGL -L-lDerelictGLU -L-lDerelictSDL -L-lDerelictUtil -L-ldl main.d

It crashes here though after saying it requires OpenGL 3.0.

Last edited by stqn (2011-12-12 23:49:29)

Offline

#3 2011-12-12 23:52:07

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: [SOLVED] Compiling a Derelict program

When I use this it says

/usr/include/d2/derelict/opengl/glx.di(36): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(36): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(37): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(37): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(38): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(38): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(39): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(39): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(40): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(40): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(41): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(41): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(42): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(42): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(43): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/opengl/glx.di(43): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/util/xtypes.di(23): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/util/xtypes.di(23): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/util/xtypes.di(24): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/util/xtypes.di(24): use of typedef is deprecated; use alias instead
/usr/include/d2/derelict/util/xtypes.di(25): use of typedef is deprecated; use alias instead

As I see it --- must the library be updated? hmm

Funny thing is, there is no "error" here, but it simply does not make an executable or anything.

Offline

#4 2011-12-12 23:56:14

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] Compiling a Derelict program

I didn't get this message so yeah I'd guess your Derelict2 is older than r593. Or maybe your dmd2 is newer than mine smile.

Edit: I do have typedefs in my glx.di file...

Edit2: found it: typedef was deprecated on November 8th smile So my version from October 21th doesn't show the message. But it shouldn't prevent you from building the program.

Last edited by stqn (2011-12-13 00:10:35)

Offline

#5 2011-12-13 00:16:50

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: [SOLVED] Compiling a Derelict program

Now this is just messed up.
I tried GDC now, because DMD2 wouldn't even recompile Derelict for some reason.
If I now try the "dmd" command (which is linked to "gdmd") I get:

main.d:212: Warning: statement is not reachable

(which isn't true, note that this is with -w and -wi flags)
(( EDIT Nevermind, this is actually true. It's late, I'll go to bed. Good night for now! smile ))

However, and I just noticed, this actually compiles and runs!

It opens a window, so SDL works. But it stops just after because I don't have OpenGL 3.0 support.
Every few times I try this, it happens to be a SEGFAULT.
This doesn't look good to me. I am very quickly losing faith in D. >_<
But it is most probably fixable.

Maybe you're actually using GDC instead of DMD2?

P.s. RIGHT! I remember now: I can't use custom shaders (have tried before and got the same error, but in C and Java).
Do'h. Was a bad example to choose. But it compiles!

What I am worried about now is why it doesn't mention the deprecated typedef. Is the GDC package old?
And why doesn't DMD2 work for me?

Last edited by Nanthiel (2011-12-13 00:24:58)

Offline

#6 2011-12-13 01:19:00

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] Compiling a Derelict program

No I'm really using dmd smile. What puzzles me is why OpenGL 3.0 is required for shaders... From a quick web search it looks like OpenGL 2.0 and shaders are a possible combination...

Offline

#7 2011-12-13 08:09:06

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: [SOLVED] Compiling a Derelict program

Right — it should work with 2.0. I have only 1.4 so I have no hope of shaders anyway. Maybe the bindings have simplified error handling and just say they want 3.0 support for pretty much anything. smile

It's probably a version disparity then, with the DMD and GDC thing. I think.

Offline

#8 2011-12-13 14:48:22

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] Compiling a Derelict program

glxinfo tells me:

OpenGL version string: 2.1 Mesa 7.11.2
OpenGL shading language version string: 1.20

I'll ask aldacron (Derelict's author) why 3.0 is required when/if my dsource.org account gets enabled some day.

Since the deprecation of typedef is from last month I suppose gdc hasn't picked it up yet, yes...

Offline

#9 2011-12-14 20:05:33

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: [SOLVED] Compiling a Derelict program

I've also posted this on StackOverflow and I'll append the link to the top post and mark it as [SOLVED].

Thanks for the help!

Offline

#10 2011-12-17 05:52:12

stqn
Member
Registered: 2010-03-19
Posts: 1,191
Website

Re: [SOLVED] Compiling a Derelict program

There's a Derelict update to fix those typedefs: http://dblog.aldacron.net/2011/12/15/derelict-updates-3

(and no, my account at dsource.org has not yet been approved... sigh.)

Offline

#11 2011-12-17 10:49:37

Nanthiel
Member
From: Slovenia
Registered: 2009-09-20
Posts: 148

Re: [SOLVED] Compiling a Derelict program

I must have grabbed it when reinstalling because it works now. smile

Offline

Board footer

Powered by FluxBB