我正在尝试在QT中使用QLocalSocket,但我有错误Undefined Reference to QLocalSocket::QLocalSocket(QObject*)
这是.cpp:
的开头#include "client.h"
Client::Client(QObject *parent) :
QObject(parent),
m_socket(new QLocalSocket(this))
{
tryConnection();
}
.h
的开头#include <QObject>
#include <QtNetwork/QLocalSocket>
class Client : public QObject
{
Q_OBJECT
public:
explicit Client(QObject *parent = 0);
~Client();
我在Linux上使用QT 5.8。