Error: Unresolved external
Jeg har oprettet en klasse der skulle simulere en ElevatrosSkakt...og den kommer med følende fejl...
Error: Unresolved external 'Reality::PersonState::setFloorNo(int)' referenced from C:\CPP\ELEVATOR\MAINSIMULATION.OBJ
Klassen ser ud som følger...
#include <iostream>
#include <vector>
#include "ElevatorShaft.h"
#include "ElevatorShaft.cpp"
#include "ElevatorState.h"
#include "ElevatorState.cpp"
#include "Elevator.h"
#include "Elevator.cpp"
#include "Floor.h"
#include "Floor.cpp"
#include "Person.h"
#include "Person.cpp"
#include "PersonState.h"
#include "PersonState.cpp"
using namespace std;
using namespace Control;
using namespace Reality;
//HeaderFile
#ifndef MAINSIMULATION_H;
#define MAINSIMULATION_H;
class MainSimulation {
public:
explicit MainSimulation(vector<Person> persons);
int StartSimulation();
void InitializePerons(vector<Person> persons);
private:
ElevatorShaft elvShaft;
};
#endif;
MainSimulation::MainSimulation(vector<Person> persons) {
InitializePerons(persons);
StartSimulation();
}
int MainSimulation::StartSimulation() {
while(1) {
if(!elvShaft.hashMorePersons()) {
return 0;
} else {
elvShaft.timeTick();
}
}
}
void MainSimulation::InitializePerons(vector<Person> persons) {
for(int i = 0; i < persons.size(); i++) {
elvShaft.insertPerson(persons[i]);
}
}
int main() {
vector<Person> p;
Person p1(PersonState(8), 8, 1);
p.push_back(p1);
Person p2(PersonState(0), 0, 2);
p.push_back(p2);
Person p3(PersonState(1), 1, 6);
p.push_back(p3);
Person p4(PersonState(1), 1, 4);
p.push_back(p4);
MainSimulation ms(p);
}