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. Mingw QTcpSocket does not Connect MSVC x64 QTcpServer
Forum Updated to NodeBB v4.3 + New Features

Mingw QTcpSocket does not Connect MSVC x64 QTcpServer

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.1k 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.
  • cemaldemir07C Offline
    cemaldemir07C Offline
    cemaldemir07
    wrote on last edited by
    #1

    in Qt Creator example, everything works fine,

    in my code below

    protected:
    void incomingConnection(int socketDescripto);

    is i use above code there is no incoming connection BUT

    connect(server,SIGNAL(newConnection()),this,SLOT(sendFortune()));

    working fine.

    Client Side Compiled Mingw, Server Side Compiled MSVC x64

    why this is so?

    K 1 Reply Last reply
    0
    • cemaldemir07C cemaldemir07

      in Qt Creator example, everything works fine,

      in my code below

      protected:
      void incomingConnection(int socketDescripto);

      is i use above code there is no incoming connection BUT

      connect(server,SIGNAL(newConnection()),this,SLOT(sendFortune()));

      working fine.

      Client Side Compiled Mingw, Server Side Compiled MSVC x64

      why this is so?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @cemaldemir07

      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.

      Vote the answer(s) that helped you to solve your issue(s)

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

        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)

        cemaldemir07C kshegunovK 2 Replies Last reply
        1
        • R rafael

          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)

          cemaldemir07C Offline
          cemaldemir07C Offline
          cemaldemir07
          wrote on last edited by
          #4

          @rafael said:

          qintptr

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

          1 Reply Last reply
          0
          • R rafael

            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)

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            @rafael
            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.

            Read and abide by the 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