Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  


Ugh, I'm having issues. I'm integrating my virtual file system with the texture/font loaders and shit, and for some reason the application is crashing when it exits. I mean, its annoying, and shouldn't be happening, especially since I unit-tested the virtual file system crap and didn't find any weird errors like this.

In any case, I stripped the whole thing down to the skeleton code, and the following code *should* duplicate the error, I think -
#include "SDL_TTF.h"

int main( int argc, char* argv[] ) {
FILE* file = fopen( "data/testfile.txt", "r+b" );
char buffer[256];
memset( buffer, 0, sizeof( buffer ) );
fread( buffer, 1, sizeof( buffer )-1, file );
fclose( file );

system( "pause" );

return 0;

It should raise an unhandled exception when you click a button after the pause. I'm using MSVC7 right now, I couldn't built it in MSVC6 yet (SDL_TTF's messing with the main function, which yes omg is defined as int main( int argc, char* argv[] ) but I still get "cannot find _main" errors.

But yeah. Does anyone else get that error with the above code? Or did I manage to completely fuck something up like I did with MSVC8?

EDIT: Got it working with MSVC6. Forgot to link the SDL libs (lol). Lets see if that's the same issue with MSVC7.

EDIT2: Nope, still crashed in MSVC7. Grah.

EDIT3: lolz, just including "SDL_TTF.h" is making it crash. No idea why though - it was working fine before. *siiiigh*.

EDIT4: ...building with /MD instead of /MDd corrects the issue. Weird, and whatever.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!