Jump to content
  • Advertisement
Sign in to follow this  

Bah! Dynamic Array (Vector) Problems ...

This topic is 4792 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
	int m_windowWidth;
	int m_windowHeight;

	float m_angle;

	vector<CPlayers> m_Players;

	virtual ~CGame();

	bool Init();
	bool Shutdown();

	void SetupProjection(int width, int height);

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

	void ResetRoom();

Anyone see the problem?

Share this post

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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!