Derelict2 SDL - can't compile from Monodevelop
Minas
minas_mina1990 at hotmail.co.uk
Sat Mar 3 05:39:57 PST 2012
I have downloaded Derelict2 to start with SDL/OpenGL etc in D.
I have compiled Derelict using the visual studio solution that's
provided, but I want to use it in MonoDevelop, with Mono-D.
So I wrote a quick program:
// main.d
import std.stdio;
import derelict.sdl.sdl;
extern (C) int da_SDL_Init(int);
extern (C) uint da_SDL_GetTicks();
extern (C) void da_SDL_Delay(uint);
void main()
{
DerelictSDL.load();
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Delay(2000);
writeln(SDL_GetTicks());
DerelictSDL.unload();
}
I also created a makefile to compile it from the command line
(cmd - I'm using windows).
Here it is:
INCLUDE = -IC:\Development\Derelict2\import
LIBS = C:\Development\Derelict2\lib\DerelictSDL.lib
C:\Development\Derelict2\lib\DerelictUtil.lib
SRC = main.d
FLAGS =
main:
dmd $(SRC) $(FLAGS) $(INCLUDE) $(LIBS)
clean:
rm *.obj main.exe
By typing the command make, it compiles fine and the executable
is created. I can run it find, and 2007 is shown on the command
line. (By the way I didn't put SDL.dll in the same directory and
it works :/ - and it's not in system32. Anyone knows why?)
So I pasted the same code in MonoDevelop and set the following
project options:
http://i40.tinypic.com/nvcw9f.jpg
And I get the following error:
Building: D_Test (Debug)
Building Solution D_Test
Building: D_Test (Debug)
Performing main compilation...
Build Project
C:\D\dmd2\windows\bin\dmd.exe -c "main.d"
-of"C:\Users\Minas\Documents\Monodevelop\D\D_Test\D_Test\obj\Debug\main.obj"
-I"C:\D\dmd2\src\phobos" -I"C:\D\dmd2\src\druntime\import" -gc
-debug -IC:\Development\Derelict2\import
C:\D\dmd2\windows\bin\dmd.exe -gc -debug
-of"C:\Users\Minas\Documents\Monodevelop\D\D_Test\D_Test\bin\Debug\D_Test.exe"
"obj\Debug\main.obj"
C:\Development\Derelict2\lib\DerelictSDL.lib
C:\Development\Derelict2\lib\DerelictUtil.lib
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\Development\Derelict2\lib\DerelictUtil.lib(1) : Error 52: .DEF
Syntax Error
π
^
--- errorlevel 1
Exit code 1
Build complete -- 1 error, 0 warnings
---------------------- Done ----------------------
Build: 1 error, 0 warnings
-----------------
Why is that?
More information about the Digitalmars-d-ide
mailing list