Bah! Dynamic Array (Vector) Problems ...

Started by
3 comments, last by Wavarian 18 years, 6 months ago
I'm getting the fallowing error whenever I try to use vectors inside my class definition. c:\Documents and Settings\Zmurf\My Documents\Visual Studio\Projects\Peevish\Game.h(25): error C2143: syntax error : missing ';' before '<' Here is my class definition.
#ifndef __GL_COMPONENT
#define __GL_COMPONENT

#define PI 3.14159
#define TWO_PI PI*2.0
#define HALF_PI PI/2.0

#include <windows.h>
#include <cstdlib>
#include <gl/gl.h>
#include <gl/glu.h>
#include <math.h>
#include <vector>

#include "Player.h"

class CGame
{
private:
	int m_windowWidth;
	int m_windowHeight;

	float m_angle;

	vector<CPlayers> m_Players;

public:
	CGame();
	virtual ~CGame();

	bool Init();
	bool Shutdown();

	void SetupProjection(int width, int height);

	void Prepare(float dt);
	void GameLoop();

	void ResetRoom();
};

#endif
Anyone see the problem?
If it's possible for us to conceive it, than it must be possible.
Advertisement
The vector class is in the "std" namespace declared.

try std::vector m_Players;
sorry should be std::vector m_players;
of course!! thanq so much
If it's possible for us to conceive it, than it must be possible.
On another note, you should start getting into the habit of putting brackets around your macros. You could really end up with a really annoying compiler error later down the track.

#define TWO_PI (PI * 2.0)


Or better yet, start using constants..

const double TWO_PI = PI * 2.0;

This topic is closed to new replies.

Advertisement