I know you may regard this post as another duplicate, while it’s not. It’s not a duplicate because my code is different than others, and nobody else’s post (that I have seen) has solved my problem.
Here is my code:
#include "sprite.h"
SDL_Surface * SPRITE::screen;
int player;
void DrawPlayer(int x, int y) {
SDL_Rect rect = {x,y,20,20};
SDL_FillRect(SPRITE::screen, &rect, 0x00CC00);
}
DrawPlayer(20,20);
The error is on the line DrawPlayer(20,20);
You are not calling
DrawPlayer()from within any function.