Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conflicting types during libpcap compilation

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

like image 415
kmbm Avatar asked May 09 '26 00:05

kmbm


1 Answers

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.

like image 69
Sergio Avatar answered May 11 '26 13:05

Sergio