I have this interface :
class ISocketClient
{
public:
~ISocketClient() {}
virtual bool connectToHost(std::string const &hostname, unsigned short port) = 0;
virtual void closeClient() = 0;
virtual bool sendMessage(Message &) = 0;
virtual Message *getMessage() = 0;
};
And this is my class that inherits is:
class TCPClient : public QObject, ISocketClient
{
Q_OBJECT
public:
TCPClient(QObject *parent = 0);
~TCPClient();
bool connectToHost(std::string const &hostname, unsigned short port);
void closeClient();
bool sendMessage(Message &);
Message *getMessage();
public slots:
void readMessage();
private:
QTcpSocket *tcpSocket;
};
But when I compile I have this error:
/home/danilo_d/Epitech-Projects/Semestre5/QtNetworkTest/TCPClient.cpp:4: error: undefined reference to `vtable for TCPClient'
And when I take out my inheritance of QObject, it works.
Have any idea how I can do that ?