Hi there i have a problem with a class.
So what i did:
I created a incident.h with my class "IncidentLocation".
class IncidentLocation
{
public:
int getHouseno();
private:
int houseno;
};
class IncidentLocation
{
public:
IncidentLocation(QString city, QString street, int houseno, QString floor, QString company, QString building);
QString getCity();
QString getStreet();
int getHouseno();
QString getFloor();
QString getCompany();
QString getBuilding();
private:
QString city;
QString street;
int houseno;
QString floor;
QString company;
QString building;
};
To copy to clipboard, switch view to plain text mode
So after that i created "incident.cpp" to define all functions of the class:
#include "incident.h"
:city(city), street(street), houseno(houseno), floor(floor), company(company), building(building){}
IncidentLocation::getCity()
{
return city;
}
IncidentLocation::getStreet()
{
return street;
}
IncidentLocation::getHouseno()
{
return houseno;
}
IncidentLocation::getFloor()
{
return floor;
}
IncidentLocation::getCompany()
{
return company;
}
IncidentLocation::getBuilding()
{
return building;
}
#include "incident.h"
IncidentLocation::IncidentLocation(QString city, QString street, int houseno, QString floor, QString company, QString building)
:city(city), street(street), houseno(houseno), floor(floor), company(company), building(building){}
IncidentLocation::getCity()
{
return city;
}
IncidentLocation::getStreet()
{
return street;
}
IncidentLocation::getHouseno()
{
return houseno;
}
IncidentLocation::getFloor()
{
return floor;
}
IncidentLocation::getCompany()
{
return company;
}
IncidentLocation::getBuilding()
{
return building;
}
To copy to clipboard, switch view to plain text mode
Now QtCreator says for every get-Function:
>> ISO C++ forbids declaration of 'getXXXX' with no type
>> prototype for 'int IncidentLocation::getXXXX()' does not match any in class 'IncidentLocation'
>> candidate is: QString IncidentLocation::getXXXX()
What the fuck is the problem? Dont get the error i made.
Please help not to went crazy -.-
Greetz
Bookmarks