[SDL] Program crashes in release build

fuzzyTew fuzzytew at gmail.com
Wed Apr 15 10:35:06 PDT 2009


On Wed, Apr 15, 2009 at 9:57 AM, Mybowlcut <mybowlcut at hotmail.com> wrote:
> I was just experimenting then, and I found that excluding all the other
> source files except main and bringing main down to this fixes the problem:
>
> #include "sdl.h"
>
> int main(int argc, char* argv[])
> {
>        return 0;
> }
>
> Unfortunately, this leaves me with no Checkers game to play. I've been
> deleting folders and files and rebuilding for almost an hour now... please
> someone tell me I don't have to do this for each source/header file in my
> project until I find the offending file. :)

Ah, so it is indeed something outside main being linked in.  Don't
worry about header files.  The problem is probably from the destructor
of an object defined statically or at file scope.  Stepping through in
a debugger should help a lot.  If that is not an option for some
reason, you're stuck with either inspection of your source or adding
and removing .cpp files until you find which one causes it.

>From the little I see, it really looks like one of your singletons
fails to initialise a pointer in its constructor.  This singleton
probably defines a static instance of itself to save you from
initialising it, so it doesn't matter whether main references it or
not.  Do you have no backtrace of the exception?



More information about the SDL mailing list