I’m developing an application that uses windows sockets. My socket class has a method named Disconnect that uses DisconnectEx, but i get the following error at linking time:
undefined reference to `DisconnectEx@16'
I’m using MinGW and i’m linking my application with the following libs:
-lws2_32 -lwsock32 -lmswsock
On msdn says that the minimum version required for this function is Windows XP or Windows Server 2003, so i defined WINVER with 0x0502, but i still get the same error.
What i’m missing here?
Thanks in advance!
What you apparently missed is this note in the MSDN documentation for the
DisconnectEx()function:Note that the MSDN documentation for
DisconnectEx()doesn’t specify a library under the Requirements section. That implies that you have to load this function dynamically at runtime via theWSAIoctl()function to obtain a function pointer.