Madalin
Madalin

Reputation: 129

Error : MFC requires use of Winsock2.h after migrating Visual C++ project to Visual Studio 2013

After migrating a project from Visual C++ to Visual Studio 2013 I receive the following error on building the project:

C1189:#error: MFC requires use of Winsock2.h

In stdafx.h I've included the following headers:

#include <afxwin.h> 
#include <afxext.h>
#include <afxdtctl.h>
#include <afxcmn.h>
#include <afxsock.h>
#include <WinSock2.h>

I've tried to change the order of the include files ( winsock before and after MFC headers ) but still the same errors.

Can anyone give me some ideas to solve this issues ? Thank you !

Upvotes: 0

Views: 3547

Answers (1)

Madalin
Madalin

Reputation: 129

Solved ! One of the .cpp files from Extern dependencies was including <winsock.h>. I've removed the include line and the problem was solved. Thank you !

Upvotes: 3

Related Questions