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.
  • ManiRonM Offline
    ManiRonM Offline
    ManiRon
    wrote on 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?

    mrjjM 1 Reply Last reply
    0
    • ManiRonM ManiRon

      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?

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 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

        • Login

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