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. Undefined reference, trying to write a TCP/IP application
QtWS25 Last Chance

Undefined reference, trying to write a TCP/IP application

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.4k Views
  • 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.
  • D Offline
    D Offline
    Dane
    wrote on last edited by
    #1

    Hello out there.

    To learn some small things about TCP/IP, I'm trying to write my own small "chat".

    It seems that there are no errors in my code, but the IDE still says: "undefined reference to '_imp___ZN10QTcpSocketC1EP7QObject'.

    So I might have forgott to link some libraries.

    Could you tell me which those are?

    Regards,

    Dane

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

      Well,

      QT += network

      in your .pro file is enough. You should post some more details.

      Tony.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dane
        wrote on last edited by
        #3

        Hi,

        I think it's still not working correctly.

        My .pro file looks like this:

        @#-------------------------------------------------

        Project created by QtCreator 2010-08-02T14:56:46

        #-------------------------------------------------

        QT += core
        += network

        QT -= gui

        TARGET = SERVER_CLIENT
        CONFIG += console
        CONFIG -= app_bundle

        TEMPLATE = app

        SOURCES += main.cpp
        client.cpp
        server.cpp
        packetwriter.cpp
        packetreader.cpp

        HEADERS +=
        client.h
        server.h
        packetwriter.h
        packetreader.h
        @

        The errors do still exist.

        Regards,

        Dane

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          Try replacing lines 7 and 8 are not correct qmake syntax. Try @QT += core network@ instead.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Dane
            wrote on last edited by
            #5

            Hi,
            It works now perfectly - Thanks a lot.

            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