Sign in to follow this  

SDL SIGSEGV after Variable Declaration

This topic is 3595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Strange problem (to me anyway)... I'm reading in variables from a script that is located in a text file. I am reading them into the variables that I have declared inside a derived class. Up to a point, everything works fine. Then, when I add the following line: char actionText[ 7 ] = "action"; the program crashes, giving me a SIGSEGV fault. The debugger points to the line: tempKey = SDL_MapRGB( m_Image->format, colorKey.r, colorKey.g, colorKey.b ); Which is located in the base class! If I comment out the actionText line, everything works fine. The strange thing is... the SDL_MapRGB line comes before the actionText line in the code. In other words, the derived class is instantiated, which then calls the base class to set that up. Then the derived class calls a function that executes the SDL_MapRGB line. Then after that, the derived class creates the actionText variable. Once again, if the actionText line is commented out, the program works fine. HELP!

Share this post


Link to post
Share on other sites

This topic is 3595 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this