SDL Help

Started by
2 comments, last by TeraByte 21 years, 7 months ago
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.
"Though i walk through the valley of the shadow of death, iwill fear no evil, for i am the meanest motherfucker in the valley."
Advertisement
You know what a segmentation fault is caused by, correct? Is ''frame'' greater than or equal to 1? Does ''Data'' refer to valid memory?
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?
"Though i walk through the valley of the shadow of death, iwill fear no evil, for i am the meanest motherfucker in the valley."
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?
"Though i walk through the valley of the shadow of death, iwill fear no evil, for i am the meanest motherfucker in the valley."

This topic is closed to new replies.

Advertisement