• Advertisement
Sign in to follow this  

Bah! Dynamic Array (Vector) Problems ...

This topic is 4522 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 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?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
The vector class is in the "std" namespace declared.

try std::vector m_Players;

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
sorry should be std::vector m_players;

Share this post


Link to post
Share on other sites
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;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement