May 2, 2011 at 9:58am UTC
Hi there,
I need someone's help to resolve this issue.
I have one header file, LocationData.h and one source file, LocationData.cpp.
When I debug the program, I received and error: In file included from LocationData.cpp:9:
Below is the codes for the LocationData.h. I alreay included #include "LocationData.h" in the cpp file.
LocationData.h:
#ifndef LOCATIONDATA_H
#define LOCATIONDATA_H
#include <cstdlib>
#include <string.h>
using namespace std;
class LocationData{
private:
string sunType;
int noOfEarthLikePlanets;
int noOfEarthLikeMoons;
float aveParticulateDensity;
float avePlasmaDensity;
public:
// Constructors with default
LocationData();
LocationData(string, int, int, float, float);
string getSunType() { return sunType; }
int getNoOfEarthLikePlanets() { return noOfEarthLikePlanets; }
int getNoOfEarthLikeMoons() { return noOfEarthLikeMoons; }
float getAveParticulateDensity() { return aveParticulateDensity; }
float getAvePlasmaDensity() { return avePlasmaDensity; }
void setSunType(string type) { sunType = type; }
void setNoOfEarthLikePlanets(int planet) { noOfEarthLikePlanets = planet; }
void setNoOfEarthLikeMoons(int moon) { noOfEarthLikeMoons = moon; }
void setAveParticulateDensity(float avgPD) { aveParticulateDensity = avgPD; }
void setAvePlasmaDensity(float avgPlasma) { avePlasmaDensity = avgPlasma; }
//toString() method that returns a String, containing the name of each attribute and its values
string toString();
//static method computeCivIndex()
static float computeCivIndex(string, int, int, float, float);
};
#endif
May 2, 2011 at 10:07am UTC
What exactly was the error message?
Last edited on May 2, 2011 at 11:40am UTC
May 2, 2011 at 2:19pm UTC
As I say, "In file included from LocationData.cpp:9:"
May 2, 2011 at 2:49pm UTC
That tells you where the error message is, but it must surely tell you an error message as well. Try expanding the error message column in your IDE error list. (What IDE are you using, by the way?)