9
#include <arpa/inet.h>

I am getting this type of error

Cannot open include file: 'arpa/inet.h':

How do I include this header file? I am actually doing this code in VC++2012.

alk
  • 69,737
  • 10
  • 105
  • 255
user3580005
  • 101
  • 1
  • 1
  • 2

1 Answers1

16

Windows uses different headers and implementation for Berkeley sockets instead of the Unix <arpa/inet.h> headers; you need to use a different header and group of functions.

#include <Winsock2.h>

More information about this is in the Winsock2 documentation.

See also: Where do I get arpa/inet.h.

Community
  • 1
  • 1
Leigh
  • 12,038
  • 4
  • 28
  • 36