Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. QTcpSocket: No such file or directory

QTcpSocket: No such file or directory

Scheduled Pinned Locked Moved C++ Gurus
8 Posts 4 Posters 15.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rklein3013
    wrote on last edited by
    #1

    Going by the tutorial on http://www.bogotobogo.com/Qt/Qt5_QTcpSocket.php page, it states to put in a #include <QTcpSocket> in the mytcpsocket.h header file. But I recieve the following message: QTcpSocket: No such file or directory. When I type #include < a list of header files appear but QTcpSocket is not listed. Is there something else I need to install in order to create sockets?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on last edited by
      #2

      Did you add QT += network to your pro file?

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rklein3013
        wrote on last edited by
        #3

        The pro file has the following:

        QT += core gui
        greaterThan(QT_MAJOR_VERSION, 4) QT += widgets

        then the target, template, sources headers and forms.

        I need to add another line for QT += network after the QT += core gui?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          No, you can also append it after gui. You have the choice

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rklein3013
            wrote on last edited by
            #5

            Thanks, works now.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You're welcome !

              Since you have your code running, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              mandruk1331M 1 Reply Last reply
              0
              • SGaistS SGaist

                You're welcome !

                Since you have your code running, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                mandruk1331M Offline
                mandruk1331M Offline
                mandruk1331
                wrote on last edited by
                #7

                @SGaist I have the same problem and I have done everything listed above but nothing help what is the problem?? I just can't realize

                QT += core
                greaterThan(QT_MAJOR_VERSION, 4) QT += widgets
                QT -= gui
                QT += network
                CONFIG += c++11

                TARGET = Server_Part
                CONFIG += console
                CONFIG -= app_bundle

                TEMPLATE = app

                SOURCES += main.cpp
                my_server.cpp

                HEADERS +=
                my_server.h

                Mandruk1331

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Hi,

                  Did you rebuild from scratch after modifying your .pro file ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved