need help with struct

i have a problem with my struct, and i cant seem to figure out what to do to fix it :S
here is the code(its in a seperate header file):

1
2
3
4
5
6
7
8
9
10
11
#ifndef TILE_H
#define TILE_H
#include "sdl.h"

struct tiles {
	int id;
	bool solid;
	SDL_Rect clip;
};

#endif 


and here is the errors i get:

1
2
3
tile.h(5): error C2236: unexpected 'struct' 'tiles'. Did you forget a ';'?
tile.h(5): error C2143: syntax error : missing ';' before '{'
tile.h(5): error C2447: '{' : missing function header (old-style formal list?)


what have i done wrong?
I'd say the problem lies in sdl.h.
i highly doubt that, as it is a widely used library...and i myself has used it for a long time, without any problems.
closed account (zb0S216C)
Perhaps tiles is conflicting with another identifier? Or maybe TILE_H has already been defined?

Wazzak
i have used tiles before without problems. and i tried changing the TILE_H to something else, but it didn't work...
any other ideas?
Maybe there is an error in the file that includes tiles.h? Does this code compile if you put it in an empty source file?
#include "tiles.h"
You need to show us the source file that you are trying to compile.
i tried making a new project, to see if i could get it to work, and it seems like it does work now.

i have no idea what i did wrong, but at least i think i have got it working. luckily i had only gotten like 200-300 lines of code, so i dont loose much work :)
luckily i had only gotten like 200-300 lines of code

Maybe I'm just a newbie, but isn't 200-300 a lot?
Maybe I'm just a newbie, but isn't 200-300 a lot?


No.

Anyway, just taking a guess: The header included before tiles.h may have been missing a semicolon. It's hard to say without anything to look at. The snippet posted is fine.
"Maybe I'm just a newbie, but isn't 200-300 a lot? "

no its not really alot. especially when i no what to write.
Topic archived. No new replies allowed.