对QLocalSocket :: QLocalSocket(QObject *)的未定义引用

时间:2017-04-28 13:18:38

标签: c++ qt sockets qlocalsocket

我正在尝试在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。

0 个答案:

没有答案