Multithread lock errors?

Yesterday, my in-progress game was working pretty well,
though I was getting a random seg-fault once in a while. To
better figure out what was going on, I added try-catch
blocks in my code. I don’t know what I did, but now when I
try to run my program I get to the video init section of my
code:

int main( int argc, char* argv[] )
{
const std::string funcName = “Main()”;

const SDL_VideoInfo* info = NULL;

gameState.waitingForCharSelection = TRUE;
gameState.characterSelected = NULL;
gameMap = new GameMap();

// Wipe keys array
for (int i=0;i<1024;i++)
keys[i] = 0;

*** if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {
/* Failed, exit. */
fprintf( stderr, “Video initialization failed:
%s\n”,
SDL_GetError( ) );
quit( 1 );
}

and as soon as execution gets to the *** line, I get an
"unexpected multithread lock error". This is using Visual
C++ 6. This is very frustrating, as it is nearly impossible
to debug. Is this a common error or is anyone able to help
me with this?

Thanks in advance.

Harry

I guess you have changed the code-generation settings
to “Debug Multithreaded DLL” which is found in

Project -> Settings -> C/C++ -> Use run-time library

Just a maybe…

/Olof

Harry Colquhoun: “[SDL] Multithread lock errors?” (2003-06-15 13:23)

#Yesterday, my in-progress game was working pretty well,
#though I was getting a random seg-fault once in a while. To
#better figure out what was going on, I added try-catch
#blocks in my code. I don’t know what I did, but now when I
#try to run my program I get to the video init section of my
#code:#
#int main( int argc, char* argv[] )
#{

const std::string funcName = “Main()”;

const SDL_VideoInfo* info = NULL;

gameState.waitingForCharSelection = TRUE;

gameState.characterSelected = NULL;

gameMap = new GameMap();

// Wipe keys array

for (int i=0;i<1024;i++)

keys[i] = 0;

#*** if( SDL_Init( SDL_INIT_VIDEO ) < 0 ) {

/* Failed, exit. */

fprintf( stderr, "Video initialization failed:

#%s\n",

SDL_GetError( ) );

quit( 1 );

}

#and as soon as execution gets to the *** line, I get an
#“unexpected multithread lock error”. This is using Visual
#C++ 6. This is very frustrating, as it is nearly impossible
#to debug. Is this a common error or is anyone able to help
#me with this?

#Thanks in advance.

#Harry

#_______________________________________________
#SDL mailing list
#SDL at libsdl.org
#http://www.libsdl.org/mailman/listinfo/sdl