I'm trying to develop a simple application in C++ that sends Files between two computers over LAN. After some research i found out that the QtNetwork Module is the way to go. I do include the QTcpServer and QTcpSocket in my solution.
#include <QTcpServer>
#include <QTcpSocket>
I added the following path to the Additional Include Directories of my project.
C:\Qt\5.14.2\msvc2017_64\include\QtNetwork
I then tried a very simple Code.
QTcpSocket* pTcpSocket = new QTcpSocket();
I get the "unresolved external symbol" Error which means that the functions are declared but are not defined. It seems to be a problem with the linking or building of the QtNetwork Module. On the Qt Website i found out that one should add the following line
QT += network
Since I have no experience with cmake or qmake i'm not sure where to add this line
Can anyone please recommend a simple example or explain how to correctly use the Module?
The line QT += network must be included in the pro file.. or just append it if you already have other modules..
example
##################################################
# MY_APP_GUI #
##################################################
QT += core gui network concurrent
CONFIG += c++14
..
after that just run qmake again and you are ready to go! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With