Sign in to follow this  
daniel_i_l

Wierd error

Recommended Posts

daniel_i_l    295
I have a file like this:
class Vec
{
public:
	void	transform( const Matrix& m );
	void	transform3( const Matrix& m );

	float	x,y,z;
	float	w;		// 4th homogenous coordinate 
	float	u,v;	// texture position
	int		bone;	// index into Model bones array
};

class Tri
{
public:
	int		v[3];	// indices into vertices[]
	int		n[3];	// indices into normals[], normal per vertex
};

class Normal
{
public:
	float	x,y,z;
};
	

class Shape 
{
	public:
		/*	Constructor. */
		Shape();

		/*	Destructor. */
		~Shape();

		bool	loadFromFile( const char *filename );
		bool    loadFromMs3dAsciiSegment( FILE *file );

		bool	saveToFile( const char *filename );
		void	render( void );

//	private:
		int	num_vertices;
		Vec	*vertices;

		int	num_triangles;
		Tri	*triangles;

		int	num_normals;
		Normal	*normals;  //HERE IS THE ERROR


};

and compiled it with Dev C++. I got this error: 69 C:\Dev-Cpp\Examples\height2\model.h ISO C++ forbids declaration of `Normal' with no type 69 C:\Dev-Cpp\Examples\height2\model.h expected `;' before '*' token But Normal is defined in the same file!? Why did I get that error? Thanks.

Share this post


Link to post
Share on other sites
daniel_i_l    295
Something even stranger happened, I changed the name of the Normal class to Norm and it worked? Why?
Thanks.

[Edited by - daniel_i_l on April 24, 2006 6:51:53 AM]

Share this post


Link to post
Share on other sites
Feidias    92
This could be the dreaded DevC++ dependency checking problem. First make sure all modules are compiled and up to date. You can't be sure about that if the slow, idiotic dependecy checking is turned off (it usually is, unless you want to wait for the christmas every time you compile). Check the time stamps of .o files to see if they really are up to date.

Share this post


Link to post
Share on other sites
Feidias    92
I don't have patience to explain it right now. Just re-build (use Clean before building the project) everything and check that .o files are up to date. Then see what happens.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this