3

I'm trying to compile libpcap with cross compilator arm-linux-gcc. When I run 'make' I get an error:

./pcap-linux.c:254:14: conflicting types for socklen_t /usr/arm-linux-gnueabi/include/unistd.h:275:21: note previous declaration of 'socklen_t' 

I've also tried to compile it using common gcc but i have the same error. I work on ubuntu. How to resolve this problem

kmbm
  • 115
  • 2
  • 9

1 Answers1

3

pcap-linux.c makes an alias in next way:

#ifndef HAVE_SOCKLEN_T
typedef int     socklen_t;
#endif

You should pass -DHAVE_SOCKLEN_T to compiler or put

#define HAVE_SOCKLEN_T

to some header (usually it is done automatically by configure script or similar, that generates config.h).

Seems like you skipped build configuration step, so be ready to see another weird build errors.

Sergio
  • 8,099
  • 2
  • 26
  • 52