Jump to content
  • Advertisement
Sign in to follow this  
TotusTuus07

SDL SIGSEGV after Variable Declaration

This topic is 3778 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!