Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Unable to include <QtcpSocket>
Forum Updated to NodeBB v4.3 + New Features

[Solved] Unable to include <QtcpSocket>

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 12.0k Views 1 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.
  • J Offline
    J Offline
    justdad
    wrote on last edited by
    #1

    I a doing something wrong. I am trying to get a mail program up and I am compiling example code. In the code it does an include block shown below. However, it says that it can not find <QTcpSocket>,<QAuthenticator>,<QSslSocket>. However I can see these files in C:\QsSDK\Desktop\Qt\4.7.3\minigq\include\Qt for the .h files and C:\QsSDK\Desktop\Qt\4.7.3\minigq\include\Qt\QtNetwork for the cpp file I think. What include path/options am I missing?

    #include <QString>
    #include <QStringList>
    #include <QObject>
    #include <QTcpSocket>
    #include <QPointer>
    #include <QAuthenticator>
    #include <QSslSocket>

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rahul Das
      wrote on last edited by
      #2

      Have you added the network module in the *.pro file ?

      @QT += network@


      Declaration of (Platform) independence.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        I know most of the example state otherwise but you should always use the library prefix when including headers, especially with Mac OS X frameworks and non-qmake projects.
        @
        #include <QtCore/QString>
        @
        In addition - as Rahul Das said - you will have to add the corresponding modules in your project file.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          justdad
          wrote on last edited by
          #4

          This was it. I knew it was something easy. Thanks!

          Ken

          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