Unknown Type Name 'Entity' CAIBehavior.hpp

Hi

I am also getting the following build errors:

Unknown Type Name 'Entity' CAIBehavior.hpp

CAIBehavior is a member variable of IntelligentEntity which inherits from WalkingEntity which inherits from EmptyPawn which inherits from Entity.

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.
Last edited on
Ok. I'm getting two errors. Call-to implicitly deleted copy constructor of Advisor in MessageManager.hpp.

This is MessageManager.hpp:

//
// MessageManager.hpp
// RavenTek
//
// Created by Walter Gress V on 12/19/19.
// Copyright © 2019 Walter Gress V. All rights reserved.
//

#ifndef MessageManager_hpp
#define MessageManager_hpp

#include <stdio.h>
#include <queue>
#include "Message.hpp"
#include "Entity.hpp"
#include <iostream>
#include "Arbiter.hpp"
#include "MessageEnums.hpp"
#include "BaseEntity.hpp"
#include "Entity.hpp"
#include "WeaponEntity.hpp"
#include "WalkingEntity.hpp"
#include "IntelligentEntity.hpp"
#include "EmptyPawn.hpp"
#include "PlayerCharacter.hpp"
#include "StaticMesh.hpp"
#include "MessageEnums.hpp"
#include "Scheduler.hpp"

using namespace std;
//queues and deques messages


/* Entities are FSMS. FSMs operate on input messages. FSMs only operate on Messages
when its their turn. */


class MessageManager
{
public:
//queue<Message> msg_pipeline;
void remove(Message m);
void remove(Entity e);
vector<Advisor> arbitration_list;
//Message retrieve(Message m);
//queue<Entity> entity_collection;
//void update(Entity e, Message m);
Arbiter arbitrationer;
//std::queue<Message> Message get_msg_pipeline();
//arbitationer.arbitrate(queue<Message> arbitration_list); //the updated message pipeline

//void Update(Entity e, Message m);




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.

Last edited on
Topic archived. No new replies allowed.