I made a header file named Globals.h to put all my global variables in and declare my functions. Well when I compile it useing bloodshed it gives me:
Globals.h no such file
and then says my variables arent being declaired.
// MAIN
#include <iostream>
#include "Globals.h"
using namespace std;
int playercharacter();
int PName();
int Gender();
int Race();
int Profession();
int Human();
int Elf();
int Dwarf();
int Warrior();
int Wizard();
int Cleric();
int main()
{
bool charactersetup = false;
if(charactersetup == false)
{
cout << " Welcome to Kesmere\n\n\n ";
PName();
Gender();
Race();
Profession();
charactersetup = true;
}
else
{
}
system("pause");
return 0;
}
int PName()
{
char name[50];
cout << " Enter your name\n\n";
cin >> name;
cout << " You have chosen to be known as " << name << ".\n\n";
}
int Gender()
{
int gender;
string gendername;
cout << " Please choose your gender\n";
cout << "1. Male" << endl;
cout << "2. Female\n\n";
cin >> gender;
if(gender == 1)
{
gendername = "male";
cout << "You have chosen to play as a " << gendername << endl;
}
else
{
gendername = "female";
cout << "You have chosen to play as a " << gendername << "\n\n";
}
}
int Race()
{
int rchoice;
cout << " Please chose:\n";
cout << " 1. human " << endl;
cout << " 2. elf " << endl;
cout << " 3. dwarf " << endl;
cin >> rchoice;
switch(rchoice)
{
case 1:
Human();
break;
case 2:
Elf();
break;
case 3:
Dwarf();
break;
}
}
int Profession()
{
int pchoice;
cout << " Please chose:\n";
cout << " 1. warrior " << endl;
cout << " 2. wizard " << endl;
cout << " 3. cleric " << endl;
cin >> pchoice;
switch(pchoice)
{
case 1:
Warrior();
break;
case 2:
Wizard();
break;
case 3:
Cleric();
break;
}
}
int Human()
{
string race = " human ";
hp = 10;
dex = 8;
mana = 6;
cout << "You have chosen to play as a" << race << "." << "\n\n";
cout << " You now have:" << endl;
cout << " Hit Points: " << hp << endl;
cout << " Dexterity: " << dex << endl;
cout << " Mana: " << mana << "\n\n";
}
int Elf()
{
string race = " elf ";
hp = 9;
dex = 7;
mana = 10;
cout << "You have chosen to play as a" << race << "." << "\n\n";
cout << " You now have:" << endl;
cout << " Hit Points: " << hp << endl;
cout << " Dexterity: " << dex << endl;
cout << " Mana: " << mana << "\n\n";
}
int Dwarf()
{
string race = " dwarf ";
hp = 12;
dex = 9;
mana = 5;
cout << "You have chosen to play as a" << race << "." << "\n\n";
cout << " You now have:" << endl;
cout << " Hit Points: " << hp << endl;
cout << " Dexterity: " << dex << endl;
cout << " Mana: " << mana << "\n\n";
}
int Warrior()
{
string profession = " warrior ";
cout << "You have chosen to play as a" << profession << "\n\n";
}
int Wizard()
{
string profession = " wizard ";
cout << "You have chosen to play as a" << profession << "\n\n";
}
int Cleric()
{
string profession = " cleric ";
cout << "You have chosen to play as a" << profession << "\n\n";
}
and here is my global.h code
#include <iostream>
using namespace std;
int hp;
int dex;
int mana;