Jump to content
  • Advertisement
Sign in to follow this  

Trouble using SFont and SDL_image

This topic is 5219 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'm getting the following error when compiling my code:
dev@OnTheHeap:~/Code/SDL/Projects/Asteroids$ make
gcc -Wall asteroids.c SFont.o -o asteroids `sdl-config --libs --cflags`
In file included from asteroids.c:22:
asteroids.h:23: error: parse error before '*' token
asteroids.h:23: warning: type defaults to `int' in declaration of `Font'
asteroids.h:23: warning: data definition has no type or storage class
make: *** [asteroids] Error 
This is the section of code it is referring to:

SDL_Surface *background;
SDL_Surface *screen;
SDL_Surface *asteroid_big;
SDL_Surface *asteroid_small;
SDL_Surface *new_game_screen;

SFont_Font *Font;

int end_game_loop = 0;
int player_ships = 3;
int current_level = 1;
int player_won = 0;

Uint8* keys;

When I comment out SFont_Font *Font; it compiles fine. I can't find any parse errors... what am I doing wrong? (If you need more info just ask)

- Stephen

Share this post

Link to post
Share on other sites
That looks like you need to include the header files for SFont, unless that is a class that you have written. What header files have you included?

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!