Undefined reference, trying to write a TCP/IP application



  • 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



  • Well,

    QT += network

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

    Tony.



  • 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


  • Moderators

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



  • Hi,
    It works now perfectly - Thanks a lot.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.