Jump to content
  • Advertisement
Sign in to follow this  

SDL SIGSEGV after Variable Declaration

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

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!