digitalmars.D - Help with derelict and codeblocks
- Jarno Tuomainen (29/29) May 09 2006 Simple question: anyone got derelict working with codeblocks ide
- Mike Parker (2/34) May 09 2006 Make sure the derelict modules are on your import path.
- Jarno Tuomainen (9/10) May 10 2006 They should be. Because if i break paths, error goes like this:
- Mike Parker (3/18) May 10 2006 Ah, of course. Missing symbols means the libraries aren't on the linker
- Jarno Tuomainen (8/10) May 11 2006 Had time to play it bit more today and had little progress.
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (4/11) May 11 2006 It's called "-O2" in GDC, but in DMD it's instead called "-O"
- Mike Parker (17/30) May 11 2006 By default, Code::Blocks sets the compiler for D projects to be "GNU GDC...
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (15/20) May 10 2006 I think the Derelict library uses "pragma(lib)" to
- Mike Parker (2/5) May 11 2006 Incorrect. None of the packages do that. Only the examples.
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (3/7) May 11 2006 Sorry, my bad. And it seemed that the OP got it fixed anyway.
- OoPs-Tk (30/30) Dec 20 2006 I am just starting out in C++ one tut I have been using give me a
- Bill Baxter (5/50) Dec 20 2006 Um... this is a newsgroup for the D programming language.
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 09 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 09 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:Ah, of course. Missing symbols means the libraries aren't on the linker path. Make sure to add them in the project properties.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
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 warningsIt'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
Jarno Tuomainen wrote:Mike Parker wrote: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.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: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 10 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
Mike Parker wrote:Sorry, my bad. And it seemed that the OP got it fixed anyway. --andersI 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
I am just starting out in C++ one tut I have been using give me a roll dice program pretty much I have followed his steps perfectly but an dgetting this: .objs\main.o:main.cpp:(.text+0x13f): undefined reference to `rollDice()' collect2: ld returned 1 exit status Process terminated with status 1 (0 minutes, 0 seconds) 0 errors, 0 warnings everytime I try and build. I am using codeblocks. Below is a copy of the code I am using any help would be much appreciated. #include <iostream> #include <ctime> using namespace std; void rollDice (void); int main() { srand(time (0)); rollDice(); return 0; } void rolldice(void) { int die1; int die2; die1 = 1 + rand() % 6; die2 = 1 + rand() % 6; cout <<"the first dice is"<<die1 <<endl; cout <<"the second dice is"<<die2 <<endl; }
Dec 20 2006
OoPs-Tk wrote:I am just starting out in C++ one tut I have been using give me a roll dice program pretty much I have followed his steps perfectly but an dgetting this:Um... this is a newsgroup for the D programming language. You should ask this on a C++ newsgroup. (But hint -- C++ is case-sensitive. rolldice!=rollDice). --bb.objs\main.o:main.cpp:(.text+0x13f): undefined reference to `rollDice()' collect2: ld returned 1 exit status Process terminated with status 1 (0 minutes, 0 seconds) 0 errors, 0 warnings everytime I try and build. I am using codeblocks. Below is a copy of the code I am using any help would be much appreciated. #include <iostream> #include <ctime> using namespace std; void rollDice (void); int main() { srand(time (0)); rollDice(); return 0; } void rolldice(void) { int die1; int die2; die1 = 1 + rand() % 6; die2 = 1 + rand() % 6; cout <<"the first dice is"<<die1 <<endl; cout <<"the second dice is"<<die2 <<endl; }
Dec 20 2006