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. Whoops -complier see Qt "connect" is a "dupe"....

Whoops -complier see Qt "connect" is a "dupe"....

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 551 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    Another C++ snag . NOT a Qt issue .
    In order to fix a bluetooth issue I decided to KISS and use very simple and direct C code.
    I am also using Qt "connect".

    Using socket I am about to "connect" to client , BUT
    Qt and socket(s) are using SAME function name , hence compiler is complaining about "no matching function ".

    I am open to any reasonable hack to solve the issue.

     status = connect(s, (struct sockaddr *)&addr, sizeof(addr));
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @AnneRanch said in Whoops -complier see Qt "connect" is a "dupe"....:

      I am open to any reasonable hack to solve the issue.

      No need for a hack, just basic c++ knowledge is needed. When you want to call the connect() which is not in a namespace you have to prefix it with ::.

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

      kshegunovK 1 Reply Last reply
      7
      • Christian EhrlicherC Christian Ehrlicher

        @AnneRanch said in Whoops -complier see Qt "connect" is a "dupe"....:

        I am open to any reasonable hack to solve the issue.

        No need for a hack, just basic c++ knowledge is needed. When you want to call the connect() which is not in a namespace you have to prefix it with ::.

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

        @Christian-Ehrlicher said in Whoops -complier see Qt "connect" is a "dupe"....:

        When you want to call the connect() which is not in a namespace you have to prefix it with ::

        If there's a ambiguity in the ADL (a.k.a. Koenig lookup), otherwise you don't have to, although one should - for clarity ...

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        4

        • Login

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