[SDL] GDB Debugger hangs with SDL with MinGW, Netbeans, Windows 7
Zcool31
dr_z0idb3rg at hotmail.com
Wed Mar 3 15:35:58 PST 2010
I'm using Netbeans 6.8, MinGW 5 point something (pretty new one), and GDB 7 point something. By themselves they work very well. However when I'm writing a program with SDL, the debugger seems to hang at initialization. I don't even have to call any SDL functions, just including the headers causes the debugger to hang.
The code below, when uncommented, should make a 640x480 opengl window and then just wait for you to close it. When I run normally (Run Main Project, F6), it works fine. It does exactly what it should. When I run with a debugger (Debug Main Project, Ctrl+F5), the program hangs before anything happens. Even when I don't call any SDL functions. Just including the headers breaks the debugger.
Code:
#include <iostream>
#include <cstdlib>
//if I don't include SDL header, debugger runs normally
#include <SDL/SDL.h>
#include <SDL/SDL_opengl.h>
//if I do, program hangs when run with debugger
//but runs ok if I run normally, without debugger
using namespace std;
//SDL_Surface* screen;
int main(int argc, char** argv) {
cout << "INITING" << endl;
//SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE);
//SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
//screen=SDL_SetVideoMode(640,480,32,SDL_OPENGL|SDL_RESIZABLE);
//SDL_Event event;
/*while(SDL_WaitEvent(&event)){
if(event.type==SDL_QUIT)
break;
}*/
//SDL_Quit();
system("PAUSE");
return 0;
}
Nobody else has this issue? Is there a way to fix this?
Please help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100303/5590260f/attachment.htm>
More information about the SDL
mailing list