Jump to page: 1 2
Thread overview
Help with derelict and codeblocks
May 09, 2006
Jarno Tuomainen
May 10, 2006
Mike Parker
May 10, 2006
Jarno Tuomainen
May 10, 2006
Mike Parker
May 11, 2006
Jarno Tuomainen
May 11, 2006
Mike Parker
May 11, 2006
Mike Parker
Dec 21, 2006
OoPs-Tk
Dec 21, 2006
Bill Baxter
May 09, 2006
Simple question: anyone got derelict working with codeblocks ide (www.codeblocks.org)?

IDE supports D and works just fine, but i cant seem to get derelict working with it (i get plenty of undefined symbol errors when i try to complie sdl stuff with it).

Complier output. This is when compiling dmedia opengl tutorial:

--- cutpaste ---
::  Symbol Undefined _glMatrixMode
::  Symbol Undefined _glLoadIdentity
::  Symbol Undefined _gluPerspective
::  Symbol Undefined _D8derelict3sdl3sdl16DerelictSDL_LoadFZv
::  Symbol Undefined _D8derelict6opengl2gl15DerelictGL_LoadFZv
::  Symbol Undefined _D8derelict6opengl3glu16DerelictGLU_LoadFZv
::  Symbol Undefined _SDL_Init
::  Symbol Undefined _SDL_GL_SetAttribute
::  Symbol Undefined _SDL_SetVideoMode
::  Symbol Undefined _SDL_WM_SetCaption
::  Symbol Undefined _SDL_PollEvent
::  Symbol Undefined _glClear
::  Symbol Undefined _SDL_GL_SwapBuffers
::  Symbol Undefined _SDL_Quit
::  Symbol Undefined _D8derelict6opengl3glu18DerelictGLU_UnloadFZv
::  Symbol Undefined _D8derelict6opengl2gl17DerelictGL_UnloadFZv
::  Symbol Undefined _D8derelict3sdl3sdl18DerelictSDL_UnloadFZv
::  Symbol Undefined _glBegin
::  Symbol Undefined _glColor3f
::  Symbol Undefined _glVertex3f
::  Symbol Undefined _glEnd
---/cutpaste---
May 10, 2006
Jarno Tuomainen wrote:
> Simple question: anyone got derelict working with codeblocks ide (www.codeblocks.org)?
> 
> IDE supports D and works just fine, but i cant seem to get derelict working with it (i get plenty of undefined symbol errors when i try to complie sdl stuff with it).
> 
> Complier output. This is when compiling dmedia opengl tutorial:
> 
> --- cutpaste ---
> ::  Symbol Undefined _glMatrixMode
> ::  Symbol Undefined _glLoadIdentity
> ::  Symbol Undefined _gluPerspective
> ::  Symbol Undefined _D8derelict3sdl3sdl16DerelictSDL_LoadFZv
> ::  Symbol Undefined _D8derelict6opengl2gl15DerelictGL_LoadFZv
> ::  Symbol Undefined _D8derelict6opengl3glu16DerelictGLU_LoadFZv
> ::  Symbol Undefined _SDL_Init
> ::  Symbol Undefined _SDL_GL_SetAttribute
> ::  Symbol Undefined _SDL_SetVideoMode
> ::  Symbol Undefined _SDL_WM_SetCaption
> ::  Symbol Undefined _SDL_PollEvent
> ::  Symbol Undefined _glClear
> ::  Symbol Undefined _SDL_GL_SwapBuffers
> ::  Symbol Undefined _SDL_Quit
> ::  Symbol Undefined _D8derelict6opengl3glu18DerelictGLU_UnloadFZv
> ::  Symbol Undefined _D8derelict6opengl2gl17DerelictGL_UnloadFZv
> ::  Symbol Undefined _D8derelict3sdl3sdl18DerelictSDL_UnloadFZv
> ::  Symbol Undefined _glBegin
> ::  Symbol Undefined _glColor3f
> ::  Symbol Undefined _glVertex3f
> ::  Symbol Undefined _glEnd
> ---/cutpaste---

Make sure the derelict modules are on your import path.
May 10, 2006
Mike Parker wrote:

> Make sure the derelict modules are on your import path.

They should be. Because if i break paths, error goes like this:

//cut
main.d:2: module sdl cannot read file 'sdl.d'
//paste

So, i think something else is messed up here.

Ofcourse, i can build stuff in dos prompt (derelict works just fine there), but because i use codeblocks to write code, dropping to dos and compiling stuff feels bit clumsy.
May 10, 2006
Jarno Tuomainen wrote:
> Mike Parker wrote:
> 
>> Make sure the derelict modules are on your import path.
> 
> They should be. Because if i break paths, error goes like this:
> 
> //cut
> main.d:2: module sdl cannot read file 'sdl.d'
> //paste
> 
> So, i think something else is messed up here.
> 
> Ofcourse, i can build stuff in dos prompt (derelict works just fine there), but because i use codeblocks to write code, dropping to dos and compiling stuff feels bit clumsy.

Ah, of course. Missing symbols means the libraries aren't on the linker path. Make sure to add them in the project properties.
May 10, 2006
Jarno Tuomainen wrote:

> So, i think something else is messed up here.
> 
> Ofcourse, i can build stuff in dos prompt (derelict works just fine there), but because i use codeblocks to write code, dropping to dos and compiling stuff feels bit clumsy.

I think the Derelict library uses "pragma(lib)" to
load the libraries (e.g. derelictUtil and derelictSDL)

This should work when doing a "one-pass" build/dmd from
the commandline, but when you are working with something
closer to the "Make" build analogy (like Code::Blocks does)
then it probably compiles the code in the first pass and
then links them together in a second link run. And it is
possible that this second run doesn't pick up on pragma(lib) ?


Try including the D libraries explicitly, in Code::Blocks ?
If this works OK, then you have run into this issue - which
is the same as what you get when running GDC and GNU Make.
(GDC does not support the pragma(lib), for linking libraries)

Code::Blocks uses the same model as C/C++, if that helps you.

--anders
May 11, 2006
Mike Parker wrote:
> Ah, of course. Missing symbols means the libraries aren't on the linker path. Make sure to add them in the project properties.

Had time to play it bit more today and had little progress.

Doesnt rant about symbols anymore, but now i get error:

-------------- Build: Release in sdl ---------------
Compiling: main.d
Error: unrecognized switch '-O2'
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
May 11, 2006
Jarno Tuomainen wrote:

> Doesnt rant about symbols anymore, but now i get error:
> 
> -------------- Build: Release in sdl ---------------
> Compiling: main.d
> Error: unrecognized switch '-O2'
> Process terminated with status 1 (0 minutes, 0 seconds)
> 0 errors, 0 warnings

It's called "-O2" in GDC, but in DMD it's instead called "-O"

If this was from the settings for the DMD compiler, it's a bug.

--anders
May 11, 2006
Anders F Björklund wrote:
> Jarno Tuomainen wrote:

> I think the Derelict library uses "pragma(lib)" to
> load the libraries (e.g. derelictUtil and derelictSDL)

Incorrect. None of the packages do that. Only the examples.
May 11, 2006
Jarno Tuomainen wrote:
> Mike Parker wrote:
>> Ah, of course. Missing symbols means the libraries aren't on the linker path. Make sure to add them in the project properties.
> 
> Had time to play it bit more today and had little progress.
> 
> Doesnt rant about symbols anymore, but now i get error:
> 
> -------------- Build: Release in sdl ---------------
> Compiling: main.d
> Error: unrecognized switch '-O2'
> Process terminated with status 1 (0 minutes, 0 seconds)
> 0 errors, 0 warnings

By default, Code::Blocks sets the compiler for D projects to be "GNU GDC Compiler" at project creation. When creating projects, make sure you select "Digital Mars D Compiler" if you are using DMD rather than GDC.

If you have created a project with the wrong compiler you can still switch the configuration by going, in the menu, to Project->Build Options. The dialog that pops up will have a tree on the left:

Project Name
    |
    |-- Debug
    |-- Release

Select "Project Name". On the right side is a drop down list named "Selected Compiler". If it is not set to "Digital Mars D Compiler", find it in the list and select it. Unfortunately, changing the compiler selection in the root configuration does not change it in the Debug and Release configurations. You will need to select each node and do the same thing.
May 11, 2006
Mike Parker wrote:

>> I think the Derelict library uses "pragma(lib)" to
>> load the libraries (e.g. derelictUtil and derelictSDL)
> 
> Incorrect. None of the packages do that. Only the examples.

Sorry, my bad. And it seemed that the OP got it fixed anyway.

--anders
« First   ‹ Prev
1 2