ahem
Which compiler is that?
You haven’t told us anything about what builds of various software you are
using. One common pitfall I have experienced developing software on Windows
is that there can be problems trying to use different compilers or tools
written for binaries generated by different compilers. If you haven’t built
your libraries yourself, you’re just in for trouble. It can be a lot of work
to get up and running, but start building your own libraries now, and save
yourself these kinds of headaches in the future.
Generally it’s been my experience that problems stem from trying to link
binaries together that have been linked to different C and/or C++ runtimes.
You could run your program within gdb within gdb (sic) and see if you can
see where it’s hanging. You’ll need a gdb build with debugging info compiled
in if you want to get anywhere.
Also it’s a little vague to me whether the “#include <SDL.h>” is triggering
your problem, or if it is actually using SDL APIs that is the problem.
Knowing your compiler would help. If it’s only the header and without using
any APIs, then with a nice compiler like gcc the only thing that should be
changed is that SDL may #define main out of the way so that it can link in
its own main routine. Try “#undef main” after “#include <SDL.h>” if you want
to try a little experiment and see if that makes a difference to how it
blows up.
Good luck :)On Wed, Mar 3, 2010 at 6:35 PM, Zcool31 <dr_z0idb3rg at hotmail.com> wrote:
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
#include
//if I don’t include SDL header, debugger runs normally
#include
#include
//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!
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
–
http://codebad.com/