Dave's Brain

Browse - Programming Tips - winsock2.h: Multiple declaration for 'fd_set'

Date: 2018mar1
OS: Windows
Language: C/C++

Q.  winsock2.h: Multiple declaration for 'fd_set'

A.  You can define WIN32_LEAN_AND_MEAN before including <windows.h> and it will not include winsock2.h

// Lean and mean avoids winsock.h which conflicts with winsock2 #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <winsock2.h>

Add a comment

Sign in to add a comment
Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.