Archived

This topic is now archived and is closed to further replies.

SDL Help

This topic is 5586 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

I keep getting this error: Fatal signal: Segmentation Fault (SDL Parachute Deployed) I keep getting it with this code: Data[frame-1].image = SDL_DisplayFormat(temp); Please help! Thanks in advance.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You know what a segmentation fault is caused by, correct? Is ''frame'' greater than or equal to 1? Does ''Data'' refer to valid memory?

Share this post


Link to post
Share on other sites
Actually, no i dont really know what it is...

Frame was 1 when i tested, and can be anything from 1 to N

Data is a structure which contains the SDL_Surface
SFrame *Data;

Then in the constructor of my class i have:
Data = new SFrame[1];

And you can change the amount of frames with a method.

What am i doing wrong?

Share this post


Link to post
Share on other sites
Ok, its working now, i added a lot of printf''s to find out exaclty what was wrong.

However, i have another problem.
My code compiles and runs the way i want it to, but if i put some of my functions as inline, it gives me an error message like:

[Linker] undefined reference to function

i have some functions as inline, and they work, but some functions just refuse to work when inline...

Can anyone help me?

Share this post


Link to post
Share on other sites