<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[VS2013 with QT5.3.2 using QWebsocket and got a unresolved external symbol issue]]></title><description><![CDATA[<p dir="auto">I got a problem with VS2013 and QT5.3.2. when I am using Websocket, it says unresolved external symbol with QWebSocket::sendTextMessage and other websocket functions.</p>
<p dir="auto">I have already #include &lt;QtWebSockets/QWebSocket&gt; and set the QT Project Setting and checked WebKit and Network Module。</p>
<p dir="auto">and this is the full error message I have got :</p>
<p dir="auto">1&gt;mainwindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QWebSocket::~QWebSocket(void)" (_<em>imp</em>??1QWebSocket@@UAE@XZ)，referenced in function "public: virtual __thiscall MWebSocket::~MWebSocket(void)" (??1MWebSocket@@UAE@XZ) 1&gt;MWebSocket.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QWebSocket::~QWebSocket(void)" (_<em>imp</em>??1QWebSocket@@UAE@XZ) 1&gt;MWebSocket.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QWebSocket::QWebSocket(class QString const &amp;,enum QWebSocketProtocol::Version,class QObject *)" (_<em>imp</em>??0QWebSocket@@QAE@ABVQString@@W4Version@QWebSocketProtocol@@PAVQObject@@@Z)，referenced in function "public: __thiscall MWebSocket::MWebSocket(class QUrl const &amp;,class QObject *)" (??0MWebSocket@@QAE@ABVQUrl@@PAVQObject@@@Z) 1&gt;MWebSocket.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __int64 __thiscall QWebSocket::sendTextMessage(class QString const &amp;)" (_<em>imp</em>?sendTextMessage@QWebSocket@@QAE_JABVQString@@@Z)，referenced in function "private: void __thiscall MWebSocket::onConnected(void)" (?onConnected@MWebSocket@@AAEXXZ) 1&gt;MWebSocket.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWebSocket::close(enum QWebSocketProtocol::CloseCode,class QString const &amp;)" (_<em>imp</em>?close@QWebSocket@@QAEXW4CloseCode@QWebSocketProtocol@@ABVQString@@@Z)，referenced in function "private: void __thiscall MWebSocket::onTextMessageReceived(class QString)" (?onTextMessageReceived@MWebSocket@@AAEXVQString@@@Z) 1&gt;MWebSocket.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWebSocket::open(class QUrl const &amp;)" (_<em>imp</em>?open@QWebSocket@@QAEXABVQUrl@@@Z)，referenced in function "public: __thiscall MWebSocket::MWebSocket(class QUrl const &amp;,class QObject *)" (??0MWebSocket@@QAE@ABVQUrl@@PAVQObject@@@Z) 1&gt;MWebSocket.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWebSocket::connected(void)" (_<em>imp</em>?connected@QWebSocket@@QAEXXZ)，referenced in function "public: __thiscall MWebSocket::MWebSocket(class QUrl const &amp;,class QObject *)" (??0MWebSocket@@QAE@ABVQUrl@@PAVQObject@@@Z) 1&gt;MWebSocket.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWebSocket::disconnected(void)" (_<em>imp</em>?disconnected@QWebSocket@@QAEXXZ)，referenced in function "public: __thiscall MWebSocket::MWebSocket(class QUrl const &amp;,class QObject *)" (??0MWebSocket@@QAE@ABVQUrl@@PAVQObject@@@Z) 1&gt;MWebSocket.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QWebSocket::textMessageReceived(class QString const &amp;)" (_<em>imp</em>?textMessageReceived@QWebSocket@@QAEXABVQString@@@Z)，referenced in function "private: void __thiscall MWebSocket::onConnected(void)" (?onConnected@MWebSocket@@AAEXXZ) 1&gt;MWebSocket.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static struct QMetaObject const QWebSocket::staticMetaObject" (_<em>imp</em>?staticMetaObject@QWebSocket@@2UQMetaObject@@B) 1&gt;debug/\MapleUI.exe : fatal error LNK1120: 9 unresolved externals</p>
<p dir="auto">this is the code for Websocket:</p>
<p dir="auto">@<br />
//HEADER<br />
#pragma once<br />
#include "global.h"</p>
<p dir="auto">class MWebSocket : public QObject<br />
{<br />
Q_OBJECT<br />
public:<br />
explicit MWebSocket(const QUrl &amp;url, QObject *parent = Q_NULLPTR);</p>
<p dir="auto">Q_SIGNALS:<br />
void closed();</p>
<pre><code>private Q_SLOTS:
void onConnected();
void onTextMessageReceived(QString message);
</code></pre>
<p dir="auto">private:<br />
QWebSocket m_webSocket;<br />
QUrl m_url;<br />
};</p>
<p dir="auto">//CPP</p>
<p dir="auto">#include "global.h"<br />
#include "MWebSocket.h"</p>
<p dir="auto">QT_USE_NAMESPACE</p>
<p dir="auto">//! [constructor]<br />
MWebSocket::MWebSocket(const QUrl &amp;url, QObject *parent) :<br />
QObject(parent),<br />
m_url(url)<br />
{<br />
connect(&amp;m_webSocket, &amp;QWebSocket::connected, this, &amp;MWebSocket::onConnected);<br />
connect(&amp;m_webSocket, &amp;QWebSocket::disconnected, this, &amp;MWebSocket::closed);<br />
m_webSocket.open(QUrl(url));<br />
}<br />
//! [constructor]</p>
<p dir="auto">//! [onConnected]<br />
void MWebSocket::onConnected()<br />
{<br />
qDebug() &lt;&lt; "WebSocket connected";<br />
connect(&amp;m_webSocket, &amp;QWebSocket::textMessageReceived,<br />
this, &amp;MWebSocket::onTextMessageReceived);<br />
m_webSocket.sendTextMessage(QStringLiteral("H2ello, world!"));<br />
}<br />
//! [onConnected]</p>
<p dir="auto">//! [onTextMessageReceived]<br />
void MWebSocket::onTextMessageReceived(QString message)<br />
{<br />
qDebug() &lt;&lt; "Message received:" &lt;&lt; message;<br />
m_webSocket.close();<br />
}<br />
//! [onTextMessageReceived]</p>
<p dir="auto">@<br />
anyone have idea about how to solve this problem? thanks</p>
]]></description><link>https://forum.qt.io/topic/51228/vs2013-with-qt5-3-2-using-qwebsocket-and-got-a-unresolved-external-symbol-issue</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 16:45:20 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/51228.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Feb 2015 11:16:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to VS2013 with QT5.3.2 using QWebsocket and got a unresolved external symbol issue on Sun, 15 Feb 2015 22:45:47 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">Maybe a silly question but did you add</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt">@<bdi>QT</bdi></a> += websockets@</p>
<p dir="auto">To your pro file ?</p>
]]></description><link>https://forum.qt.io/post/261649</link><guid isPermaLink="true">https://forum.qt.io/post/261649</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 15 Feb 2015 22:45:47 GMT</pubDate></item></channel></rss>