Code::Blocks Forums
User forums => Help => Topic started by: faragoszek on December 23, 2009, 01:41:29 pm
-
hello everyone.
here is a very simple example: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01 (bottom of page, Linux/SDL code).
created console application, set build options correctly, the program exits with:
Video mode set failed: Couldn't find matching GLX visual
when run from inside codeblocks with F9.
when i navigate to the bin/debug folder and run it from terminal or konqueror, it runs, and no error.
it must be something related to codeblocks, maybe i should build it with xwgtk instead of wxwidgets or something?
please help if you can, i have to start working on something and it will be annoying to switch to outside application just to run it.
thank you
-
it must be something related to codeblocks, maybe i should build it with xwgtk instead of wxwidgets or something?
No it's definitely not related to C::B !!
Code::Blocks is an IDE, not a compiler or a framework or anything like this.
If it does not work, it is most likely a configuration error.
I just dowloaded the example, created the sdl-sample with the wizard, replaced the original file with the one coming with the example and added GL and GLU to the link-libs (after having a look into the makefile).
I get a black-screen, that can be switched to fullscreen with F1 and an output of the framerate on the console, when running as console-program (otherwise I don't see the output).
That means everything works as I expected.
-
did exactly the same as you new cosole application->C->copied the example file over->set other linker options to `sdl-config --cflags --libs` and libraries to GL and GLU, same again.
even checked out latest source from svn and rebuilt
the error is still there
-
That's not he same !!
I used the SDL-wizard as base.
You have to split the sdl-config instruction.
with --cflags in the Other settings of the projects Compiler options and with --libs int the projects Linker settings tab Other linker options.
-
ok this is how i got it working:
new project with SDL wizard->add GL and GLU to links, copied over the source, changed to include with < > instead of " " of the SDL header.
no change
then i removed both `sdl-config --cflags` and `sdl-config --libs` and added SDL in link libraries, removed the include GL/GL and /GLU and added only SDL/SDL_opengl.h
now it works
weird thing is that the basic sdl wizard creates a project that works, but it does not use opengl