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. confusion in connect function
Forum Updated to NodeBB v4.3 + New Features

confusion in connect function

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 582 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.
  • M Offline
    M Offline
    ManiRon
    wrote on 13 Oct 2018, 10:07 last edited by
    #1

    Hello ,

    I am trying to create an socket client and server program . but i am not using QT predefined functions . I am using Windows header files to develop this program . My problem is there is a function name (connect) in TCP socket that comes under <Winsock2.h> header file similarly there is a connect function in QT TCP . I want to make the program use the windows call instead of QT predefined call?

    M 1 Reply Last reply 13 Oct 2018, 10:17
    0
    • M ManiRon
      13 Oct 2018, 10:07

      Hello ,

      I am trying to create an socket client and server program . but i am not using QT predefined functions . I am using Windows header files to develop this program . My problem is there is a function name (connect) in TCP socket that comes under <Winsock2.h> header file similarly there is a connect function in QT TCP . I want to make the program use the windows call instead of QT predefined call?

      M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 13 Oct 2018, 10:17 last edited by
      #2

      @ManiRon
      Hi
      But you can just do it ?
      Make sure to link the right DLLS for the function you use or they be
      undefined linker errors.

      like for the connect function
      https://docs.microsoft.com/en-us/windows/desktop/api/winsock2/nf-winsock2-connect

      it shows that
      alt text

      so you must link to that ws2_32.dll via the pro file.

      1 Reply Last reply
      3
      • C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 13 Oct 2018, 10:48 last edited by
        #3

        To use the connect from the global namespace you can use

        ::connect(...)
        

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        3

        1/3

        13 Oct 2018, 10:07

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved