Right. Scrap the previous post. I'm still having linker problems, even though I have put them all in the same project.
Here's the differen't files I have.
Main.cpp
Code:
#include <iostream>
#include <stdlib.h>
#include <iostream>
#include "monster.h"
using namespace std;
int main()
{
int OwnVitality;
int OwnStrength;
int OwnInteligence;
int HitPoints;
string name;
cout << "Greetings. I am Simpleton. Welcome to this land. \n";
cout << "And, young traveller, you might be? \n";
cin >> name;
cout << "Ah, " << name << "! Yes, That's right, now I remember. \n";
cout << "Well, There's no time to waste, let's throw you in to your first fight \n";
int Orc();
system("PAUSE");
return 0;
}
statcheck.cpp
Code:
// StatCheck.Cpp
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include "monster.h"
#include "statcheck.h"
using namespace std;
int GetStat(intelligence)
{
return intelligence * 2;
}
statcheck.h
Code:
//StatCheck.H
#ifndef _STATCHECK_H
#define _STATCHECK_H
int GetStat(int); // Function prototype
#endif
monster.cpp This is the file with the error in, the error reads: "27 C:\Dev-Cpp\CPP_Programs\rpg\monster.cpp
`GetStat' undeclared (first use this function)"
Code:
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include "statcheck.h"
using namespace std;
int Orc()
{
int vitality = 13;
int strength = 10;
int intelligence = 2;
string name = "Orc";
int hitpoints;
string eval;
cout << "You see an " << name << "\n";
//cout << "Vitality: " << vitality << "\n";
//cout << "Strength: " << strength << "\n";
//cout << "Intelligence: " << intelligence << "\n";
cout << "Do you wish to evaluate the " << name << "? \n";
cout << "Y or N? \n";
cin >> eval;
if (eval == "Y")
{
cout << "Stats: " cout << "Stats: " << GetStat(intelligence) << "\n"; THE ERROR IS HERE
}
//wait until user is ready before terminating the program
// to all user to see the program results
//system("pause");
//return 0;
}
monster.h
Code:
//Monster.H
#ifndef _MONSTER_H
#define _MONSTER_H
int Orc(); // Function prototype
#end
Oddly enough, "int orc()" works fine.