Walsi
12th June 2007, 08:14
In a slot function of a class a want to call another function of this class.
When I do this, I got following exception at the linking process:
undefined reference to `ClientSocket::myDecodeTcpMsg(unsigned long, unsigned char*)'
*** Exited with status: 2 ***
Here are some fragments of my Source Code:
void ClientSocket::readRequest()
{
char TcpBuffer[1500];
qint64 Size;
qint64 result_code;
dword dwMsgLength;
Size = bytesAvailable();
result_code = read ((char *) TcpBuffer, Size);
dwMsgLength = Size;
myDecodeTcpMsg (dwMsgLength, (unsigned char *) TcpBuffer);
}
Here is the slot function readRequest in which I want to call the function myDecodeTcpMsg(...)
connect(this, SIGNAL(readyRead()), this, SLOT(readRequest()));
Here is the Signal & Slot connection which "enables" the readRequest() function
class ClientSocket : public QTcpSocket
{
Q_OBJECT
public:
ClientSocket(QObject *parent = 0);
void myDecodeTcpMsg(dword dwLength, byte* pbData);
signals:
void sendResponseSignal();
private slots:
void readRequest();
private:
quint16 nextBlockSize;
};
The Headerfile looks like this!
When I do this, I got following exception at the linking process:
undefined reference to `ClientSocket::myDecodeTcpMsg(unsigned long, unsigned char*)'
*** Exited with status: 2 ***
Here are some fragments of my Source Code:
void ClientSocket::readRequest()
{
char TcpBuffer[1500];
qint64 Size;
qint64 result_code;
dword dwMsgLength;
Size = bytesAvailable();
result_code = read ((char *) TcpBuffer, Size);
dwMsgLength = Size;
myDecodeTcpMsg (dwMsgLength, (unsigned char *) TcpBuffer);
}
Here is the slot function readRequest in which I want to call the function myDecodeTcpMsg(...)
connect(this, SIGNAL(readyRead()), this, SLOT(readRequest()));
Here is the Signal & Slot connection which "enables" the readRequest() function
class ClientSocket : public QTcpSocket
{
Q_OBJECT
public:
ClientSocket(QObject *parent = 0);
void myDecodeTcpMsg(dword dwLength, byte* pbData);
signals:
void sendResponseSignal();
private slots:
void readRequest();
private:
quint16 nextBlockSize;
};
The Headerfile looks like this!