クラスに静的ポインタ変数を設定しようとしていますが、設定しようとしている変数ごとにこれらのエラーが発生します。
エラーC4430:型指定子がありません-intと見なされます。注:C++はdefault-intをサポートしていません
エラーC2040:'xscroll':'int'は'float*'とは間接レベルが異なります
エラーC2440:「初期化中」:「float**」から「int」に変換できません
これがEnemy.hのコードです
#include <windows.h>
#include "Player.h"
class Enemy
{
public:
Enemy(float xPos, float yPos);
Enemy(void);
~Enemy(void);
//update the position of the user controlled object.
void updatePosition(float timeFactor);
//loads all the enemy textures
void static loadTextures();
//creates a set number of enemies
void static createEnemies(int numEnemies, Enemy * enemyArray);
GLuint static enemyTex;
static float * xscroll;
static float * yscroll;
static Player * player;
private:
bool checkCollison(float x, float y, int radius);
float XPos;
float YPos;
};
変数を設定しようとしています
Enemy::xscroll = &xscroll;
Enemy::yscroll = &yscroll;
Enemy::player = &player;