I am trying to make a warhammer 40K army counter program so I don't have to keep using excel. My problem is that my program gets an error because I have two different objects and their header files with the same variable names.
When I am trying to run my program g++ complains that the variable has already been declared in my first object.
How do I make it so that this won't happen?
Here is a code snippit of SKulltaker.cpp program
#include "SkullTaker.h"
#include <string>
int pointCost = 140;
int minSize = 1;
int maxSize = 1;
std::vector<std::string> rules;
Here is the SkullTaker.h
class SkullTaker {
public:
SkullTaker();
SkullTaker(const SkullTaker& orig);
int getPointCost();
int getMinSize();
int getMaxSize();
std::vector<std::string> getRules();
std::string toString();
virtual ~SkullTaker();
};
My other class is the same but the name of the .cpp and .h file in KuGath.
g++ complaining that there are multiple definitions of PointCost.
Thanks,
dhoehna