This is basically the same error as your other thread. How are we supposed to know without seeing code?
If your code is too large, then start by copying your code into a separate project, and cut out the non-essential parts of your code such that it still produces the same error.
If you then still don't see what is causing the problem, post your code.
void loop()
{
cout << "Initializing MessageManager thread" << endl;
while(true)
{
//add() has created an advisor and put it on the
//arbitration_list
//perform the arbitration and decide on an advisor
//execute the arbitration results
Arbiter ab;
Advisor v = ab.decide(arbitration_list);
Scheduler sch;
/*sch.add(
v.m, v.e); //message and entity are wrapped in advisor object
*/
//sch.def();
//void add(Entity &e, Message &m); //adds a message and entity from the message pump and
//add(advisor.e, advisor.m); (in the scheduler)
//add(advisor.e, advisor.m); (in the network layer - only if flagged as host
}
}
};
The error is occurring at : Advisor v = ab.decide(arbitration_list);
Advisor is:
class Advisor
{
public:
Advisor();
Message m;
union union_base base;
float weight;
void *pEntityType;
//entity_switch entityswtch;
~Advisor();
};
Arbiter is:
#ifndef Arbiter_hpp
#define Arbiter_hpp
#include "Advisor.hpp"
#include <stdio.h>
#include <queue>
#include <vector>
/* GAME GEMS BOOK 4 SECTION 4.5'*/
class Arbiter
{
public:
Advisor decide(std::vector<Advisor> arbitration_list);
};
Advisor Arbiter::decide(std::vector<Advisor> arbitration_list)
{
//goes through advisors and decides upon one
Advisor ad;
for (int i = 0; i<arbitration_list.size(); i++)
{
if (arbitration_list[i].weight > ad.weight)
{
ad = arbitration_list[i];
}
}
return ad;
}
Advisor objects have no copy constructor in your class definition. Because you defined at least one constructor yourself, you get none for free, so there is no copy constructor for the class Advisor
Advisor v = ab.decide(arbitration_list);
ab.decide returns an Advisor object, so here you're trying to do this: Advisor v = some_Advisor_object;
which is trying to call this copy onstructor Advisor (const Advisor &);
But the copy constructor doesn't exist! So you can't use it. You can't use functions or constructors that don't exist.