In file included error.

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

What exactly was the error message?
Last edited on
As I say, "In file included from LocationData.cpp:9:"
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?)
Topic archived. No new replies allowed.