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