Ok I solved that problem. Turns out I just made a typo when I included weapon.h. My new problem is that its giving me another error 'string' does not name a type. Here is my weapon.h file.
Code:
#ifndef Weapon_H
#define Weapon_H
class Weapons {
public:
//Weapons();
string getWeaponValue(); //Legendary, Epic, unique, rare, magical, normal
string getWeaponType(); //Sword, mace, staff
string getWeaponName(); //Name the weapon
int getWeaponStats(); // damage, +mods and durability
int getMagicStats();
int getWeaponLevel(); // level of the weapon
void whoCanDrop(); //check to see which mobs can drop it
private:
string WeaponName;
string WeaponType;
string WeaponValue;
int WeaponStats;
int WeaponDamage;
int WeaponDurability;
int WeaponLevel;
int WeaponMod1; //Str
int WeaponMod2;//Hp's
int WeaponMod3;//Mp's
int WeaponMod4;//agi
int WeaponMod5; //armor
int WeaponMod6; //damage
char CanIDropIt;
};
#endif
The error, however, is catching it in main and highlights the #include "weapon.h".
Code:
#include <stdio.h>
#include <windows.h>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include "Weapon.h" <----Error at this line
using namespace std;
int main()
{
HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE );
WORD wOldColorAttrs;
CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
/*
* First save the current color information
*/
GetConsoleScreenBufferInfo(h, &csbiInfo);
wOldColorAttrs = csbiInfo.wAttributes;
int x;
string blah;
srand(time(0));
StartGame();
system ("cls");
cout <<"Welcome " <<YourName <<" to the Age of Spire!" <<endl;
cout <<endl;
system ("cls");
cout <<"You open your eyes to find yourself in a small shack. You get out of bed and"<<endl;
cout <<"walk towards the door.As you open the door you can hear the sound of metal"<<endl;
cout <<"clanging and the chatter and bustle of city life. Judging by the brightness" <<endl;
cout <<"of the sun and the heat you assume that its around noon." <<endl;
//getWeaponValue();
SetConsoleTextAttribute ( h, wOldColorAttrs);
AnyKey();
}
Gives me a the following errors:
In file included from TestAosduh.cpp
'string' does not name a type <----6 of this same error
Any help would be apprieciated Im so confused.