Yes that did solve that error, but now sadly i am getting more...
I did some cleanup and reduced the errors as much as i could, but now i've got some i can't figure out. In all i have 9 classes and each are experiencing similar errors when i try to compile. So solving them in one class will help me solve the rest. Ill show You.h's errors:
./You.h:46: error: ISO C++ forbids declaration of 'Rectangle' with no type
./You.h:46: error: expected ';' before '*' token
./You.h:47: error: ISO C++ forbids declaration of 'Rectangle' with no type
./You.h:47: error: expected ';' before '*' token
./You.h:48: error: ISO C++ forbids declaration of 'Rectangle' with no type
./You.h:48: error: expected ';' before '*' token
./You.h:49: error: ISO C++ forbids declaration of 'Rectangle' with no type
./You.h:49: error: expected ';' before '*' token
./You.h:50: error: ISO C++ forbids declaration of 'Rectangle' with no type
./You.h:50: error: expected ';' before '*' token
./You.h:113: error: 'Terrain' was not declared in this scope
./You.h:113: error: template argument 1 is invalid
./You.h:113: error: template argument 2 is invalid
./You.h:126: error: ISO C++ forbids declaration of 'Rectangle' with no type
./You.h:126: error: 'Rectangle' declared as a 'virtual' field
./You.h:126: error: expected ';' before '*' token
./You.h:137: error: 'Terrain' was not declared in this scope
./You.h:137: error: template argument 1 is invalid
./You.h:137: error: template argument 2 is invalid
./You.h:137: error: 'Projectile' was not declared in this scope
./You.h:137: error: template argument 1 is invalid
./You.h:137: error: template argument 2 is invalid
./You.h:137: error: 'object' was not declared in this scope
./You.h:137: error: template argument 1 is invalid
./You.h:137: error: template argument 2 is invalid
Here is You.h:
Code: Select all
#pragma once
#include <string>
#include <vector>
#include <cmath>
#include <Enemy.h>
#include <LevelPack.h>
#include <Object.h>
#include <Projectile.h>
#include <Rectangle.h>
#include <Shop.h>
#include <Terrain.h>
#include <TextOverlay.h>
class You
{
public:
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int WIDTH;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int HEIGHT;
int pX;
int pY;
int deltaD;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int xPos;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int yPos;
int animateY;
Image *im;
//Blood
Image *img;
int xBlood;
int yBlood;
int bloodCount;
int bL;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int healthMax;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int health;
int money;
bool dead;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
Rectangle *r;
Rectangle *r0;
Rectangle *r1;
Rectangle *rL;
Rectangle *rR;
//ORIGINAL LINE: Image[] playerPics;
//INSTANT C++ WARNING: Since the array size is not known in this declaration, Instant C++ has converted this array to a pointer. You will need to call 'delete[]' where appropriate:
Image *playerPics;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
std::vector<Image*> blood;
//Projectile variables
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
std::string P_TYPE;
int M_TYPE;
//Physics related variables
bool grounded;
//initial jump dir: 0 = L, 1 = R, -5 = not jumping
int iJump;
bool maintain;
int dir;
int t;
int v;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int a;
//INSTANT C++ TODO TASK: Native C++ only allows initialization of static const integral fields in their declarations:
int MAX;
//Creates the player
You();
//Set Your Current Position
virtual void setPos();
//Sets old
virtual void setPre();
//Set Pos for level
virtual void setXY(int x, int y);
virtual void setMoney(int i);
//Draws You
virtual void draw();
//Tests for L and sets xPos and animation type
virtual int walkL(bool buttonEventL);
//Tests for R and sets xPos and animation type
virtual int walkR(bool buttonEventR);
//Tests for S and sets yPos
virtual void jump(bool buttonEventS);
//Tests if you are in free fall and sets yPos
virtual void gravity(std::vector<Terrain*> &pack);
//Return methods
virtual int getX();
virtual int getY();
virtual std::string getPType();
virtual int getMType();
virtual int getAnim();
virtual Rectangle *getRect();
virtual int getVel();
virtual int getHealth();
virtual bool getStatus();
virtual int getMoney();
virtual void colTestTer(std::vector<Terrain*> &pack, std::vector<Projectile*> &proj, std::vector<object*> &pickups);
//Determines death- prevents all movement and loops through blood sequence.
virtual void healthTest();
};
I am extremely grateful for any help people can offer.