Я использую Theron в своем проекте как актерскую библиотеку, когда я тестирую Theron, используя проект «hello world», я встретил ошибки ниже.ошибка: недопустимое использование неполного типа 'класс Theron :: EndPoint'
#include <iostream>
#include "Theron/Framework.h"
#include "Theron/Actor.h"
#include "Theron/Receiver.h"
#include "Theron/EndPoint.h"
using namespace std;
class Actor : public Theron::Actor
{
public:
explicit Actor(Theron::Framework &framework) : Theron::Actor(framework)
{
RegisterHandler(this, &Actor::Handler);
}
private:
void Handler(const int &message, const Theron::Address from)
{
Send(message, from);
}
};
int main()
{
Theron::Receiver receiver;
Theron::Framework framework;
Actor actor(framework);
framework.Send(int(0), receiver.GetAddress(), actor.GetAddress());
receiver.Wait();
return 0;
}
g++ -Wall -fexceptions -g -ITheron/Include/ -ITheron/Include/External/
-c /home/eliteyang/dev/test/main.cpp -o obj/Debug/main.o In file included from /home/eliteyang/dev/test/main.cpp:2:0: Theron/Include/Theron/Framework.h: In member function ‘bool Theron::Framework::SendInternal(Theron::Detail::MailboxContext*, Theron::Detail::IMessage*, Theron::Address)’: Theron/Include/Theron/Framework.h:999:23: error: invalid use of incomplete type ‘class Theron::EndPoint’
if (!mEndPoint->Lookup(name, address.mIndex))
^In file included from Theron/Include/Theron/Framework.h:14:0,
from /home/eliteyang/dev/test/main.cpp:2: Theron/Include/Theron/Address.h:23:7: error: forward declaration of ‘class Theron::EndPoint’ class EndPoint;
^In file included from /home/eliteyang/dev/test/main.cpp:2:0: Theron/Include/Theron/Framework.h:1002:29: error: invalid use of incomplete type ‘class Theron::EndPoint’
return mEndPoint->RequestSend(message, name);
^In file included from Theron/Include/Theron/Framework.h:14:0,
from /home/eliteyang/dev/test/main.cpp:2: Theron/Include/Theron/Address.h:23:7: error: forward declaration of ‘class Theron::EndPoint’ class EndPoint;
^
Моя среда Ubuntu 15,04, 13,12 CodeBlocks, GCC 4.9.1.
Большое спасибо.
Ошибка компиляции, а не ошибка ссылки – eliteYang
Это поможет, если вы также разместите свой код. При первом взгляде ошибка указывает на то, что вам не хватает оператора include для заголовка класса Theron :: EndPoint. – Ionut
Добавить весь код. Пожалуйста, прочитайте [Theron start] (http://www.theron-library.com/index.php?t=page&p=getting%20started) – eliteYang