Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

socket connect() being mistaken for QT connect()

Tags:

c++

sockets

qt

I'm trying to create a socket connection from my QT application to a server(regular socket, not a QTcpSocket), to receive data from the server. The problem is, the connect method, upon compilation, gives an error, and points me in the direction of the QT connect method for connecting signals to slots. How do I tell the compiler to ignore the signal and slot function of QT and find the original socket.h connect function instead?

like image 742
Saurabh Shirodkar Avatar asked Apr 01 '17 17:04

Saurabh Shirodkar


1 Answers

You should write

::connect(...);

To use the proper function. This ensures that resolution occurs from the global namespace.

like image 180
Jonas Avatar answered Oct 17 '22 21:10

Jonas