Hi, i want to write a plugin for my app to access network (LAN).
I allready has succesfully coded Plugins, but i dont know much about network coding and read the tutorials and so on.
On some point the compiler means he has a unresolved external symbol on QAbstractSocket::catchReadyRead(char *, __int64).
Connection.obj:-1: error: Nicht aufgelöstes externes Symbol ""protected: virtual __int64 __thiscall QAbstractSocket::catchReadyRead(char *,__int64)" (?catchReadyRead@QAbstractSocket@@MAE_JPAD_J@Z)".
I think this couldn't be because i have no method like this and i dont use such a method. I have commented out most of my stuff to get a compiled version to hunt the error down but i cant find the problem.The crazy thing is that i had this plugin running and get a connection to the server.
Here is my class that i hvae derived from QTcpSocket. I think there must be the problem because it derives from QAbstractSocket.
#ifndef GUICONNECTION_H
#define GUICONNECTION_H
#include <QTcpSocket>
{
//Q_OBJECT
public:
Connection
(QObject * iParent
= NULL);
private:
enum ReadState
{
eNotReading,
eReading
};
bool mInitialized; //!< connect with server is initialized
//QDataStream mDataStream;
ReadState mReadState;
qint64 mBytesToRead;
/*
private slots:
void catchReadyReadData();
void catchConnected();
void catchDisconnected();
signals:
void newData(QByteArray & iByteArray);
*/
};
#endif // GUICONNECTION_H
#ifndef GUICONNECTION_H
#define GUICONNECTION_H
#include <QTcpSocket>
class Connection : public QTcpSocket
{
//Q_OBJECT
public:
Connection(QObject * iParent = NULL);
private:
enum ReadState
{
eNotReading,
eReading
};
bool mInitialized; //!< connect with server is initialized
//QDataStream mDataStream;
ReadState mReadState;
qint64 mBytesToRead;
/*
private slots:
void catchReadyReadData();
void catchConnected();
void catchDisconnected();
signals:
void newData(QByteArray & iByteArray);
*/
};
#endif // GUICONNECTION_H
To copy to clipboard, switch view to plain text mode
#include "Connection.h"
Connection
::Connection(QObject * iParent
), mInitialized(false)
//, mDataStream()
, mReadState(eNotReading)
, mBytesToRead(0)
{
//mDataStream.setVersion(QDataStream::Qt_4_6);
//mDataStream.setDevice(this);
/*
connect(this, SIGNAL(readyRead()),
this, SLOT(catchReadyReadData()));
connect(this, SIGNAL(connected()),
this, SLOT(catchConnected()));
connect(this, SIGNAL(disconnected()),
this, SLOT(catchDisconnected()));
*/
}
/*
void Connection::catchConnected()
{
// send identification data
}
void Connection::catchDisconnected()
{
mInitialized = false;
}
void Connection::catchReadyReadData()
{
if(mReadState == eNotReading)
{
Q_ASSERT(mBytesToRead == 0); // must be zero here
// first qint64 is expected size of data to read from server
// if we dont have them we wait
if(bytesAvailable() < (qint64)sizeof(quint64))
return;
// update size
mDataStream >> mBytesToRead;
mReadState = eReading;
}
if(mReadState == eReading)
{
Q_ASSERT(mBytesToRead); // must contain size of data to read
// if we dont have reached expected buffer size we wait
if( bytesAvailable() < mBytesToRead)
return;
// get data and emit them
QByteArray byteArray;
mDataStream >> byteArray;
emit newData(byteArray);
mReadState = eNotReading;
}
}
*/
#include "Connection.h"
Connection::Connection(QObject * iParent)
: QTcpSocket(iParent)
, mInitialized(false)
//, mDataStream()
, mReadState(eNotReading)
, mBytesToRead(0)
{
//mDataStream.setVersion(QDataStream::Qt_4_6);
//mDataStream.setDevice(this);
/*
connect(this, SIGNAL(readyRead()),
this, SLOT(catchReadyReadData()));
connect(this, SIGNAL(connected()),
this, SLOT(catchConnected()));
connect(this, SIGNAL(disconnected()),
this, SLOT(catchDisconnected()));
*/
}
/*
void Connection::catchConnected()
{
// send identification data
}
void Connection::catchDisconnected()
{
mInitialized = false;
}
void Connection::catchReadyReadData()
{
if(mReadState == eNotReading)
{
Q_ASSERT(mBytesToRead == 0); // must be zero here
// first qint64 is expected size of data to read from server
// if we dont have them we wait
if(bytesAvailable() < (qint64)sizeof(quint64))
return;
// update size
mDataStream >> mBytesToRead;
mReadState = eReading;
}
if(mReadState == eReading)
{
Q_ASSERT(mBytesToRead); // must contain size of data to read
// if we dont have reached expected buffer size we wait
if( bytesAvailable() < mBytesToRead)
return;
// get data and emit them
QByteArray byteArray;
mDataStream >> byteArray;
emit newData(byteArray);
mReadState = eNotReading;
}
}
*/
To copy to clipboard, switch view to plain text mode
I have allready deleted all not needed files and rebuild whole plugin, but this wont work. (win32-msvc2008).
Does the compiler caches some data, for faster rebuilding?
thx for suggestions to solve the problem
[Edit]
Used Qt 4.6 with QtCreator but with win32-msvc2008 spec on WinXp
FortuneClient and Network-Chat are also no longer Buildable. WTF have i made? I try reinstalling Qt.
Bookmarks