Mingw QTcpSocket does not Connect MSVC x64 QTcpServer

  • in Qt Creator example, everything works fine,

    in my code below

    void incomingConnection(int socketDescripto);

    is i use above code there is no incoming connection BUT


    working fine.

    Client Side Compiled Mingw, Server Side Compiled MSVC x64

    why this is so?

  • Moderators


    There is no dependency between different TCP apps compiled with different compilers.

    QTcpClient can be used to connect to any Tcp server app and vice versa. Also not dependent on OS.

    If you are running the described apps on same machine, you might face a problem with dlls. Object code generated with different compilers is in most cases not compatible.

    When you are running the apps on different machines, there must be another reason anyway.

  • i've had the same problem as you a while back.

    i was following an example that uses

    void incomingConnection(int socketDescriptor);

    change your declaration and definition to

    virtual void incomingConnection(qintptr socketDescriptor)

  • @rafael said:


    yes this is working, thank you, may be type of ```

  • Qt Champions 2016

    Yes, this changed between Qt 4 and Qt 5 and broke some code (int an qintptr tend to be different sizes on x64). I suppose that the example should be updated (if you saw it in the Qt 5 docs)?

    Kind regards.

Log in to reply

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