Wxwidgets error WinSock2.h ‘fd_set’ : ‘struct’ type redefinition

If you’re build the program using wxwidgets and you got an error after add WinSock2.h header like this:

Error 13 error C2011: ‘fd_set’ : ‘struct’ type redefinition C:\Program Files\Windows Kits\8.1\Include\um\WinSock2.h 125 1 sia-project

So for fix the problem, you must change setup.h from wxwidgets lib your using. Example from this project I use library from C:\wxwidgets\lib\vc_lib\mswud

So open that directory/C:\wxwidgets\lib\vc_lib\mswud and open wx directory and open file setup.h:

And after that file openned, change this code:

#define wxUSE_IPV6          0

// after changed
#define wxUSE_IPV6          1

The last now build and compile your program again, see now your program not have error again.. Happy nice codingūüėÄ
Source: http://trac.wxwidgets.org/ticket/10931

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s