:wq - blog » compiling http://writequit.org/blog Tu fui, ego eris Mon, 22 Dec 2014 14:54:59 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.5 Compiling tcpdstat on Mac OSX (quick fix) http://writequit.org/blog/2007/11/29/compiling-tcpdstat-on-mac-osx-quick-fix/ http://writequit.org/blog/2007/11/29/compiling-tcpdstat-on-mac-osx-quick-fix/#comments Thu, 29 Nov 2007 23:29:23 +0000 http://writequit.org/blog/?p=96 Quick fix for compiling tcpdstat on Mac OSX (Leopard, although probably works for Tiger too).

If you get this error:

cc -I. -I../libpcap-0.7.1 -DLINUX -D__FAVOR_BSD -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -L../libpcap-0.7.1 -c stat.c
cc -I. -I../libpcap-0.7.1 -DLINUX -D__FAVOR_BSD -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -L../libpcap-0.7.1 -c net_read.c
net_read.c:74:1: warning: "__FAVOR_BSD" redefined
<command line>:1:1: warning: this is the location of the previous definition
net_read.c:149: error: static declaration of ‘packet_length’ follows non-static declaration
tcpdstat.h:415: error: previous declaration of ‘packet_length’ was here
make: *** [net_read.o] Error 1

Edit the net_read.c file and change line 149 from this:

static int packet_length; /* length of current packet */

to this:

int packet_length; /* length of current packet */

Simple eh? Just type “make” again and tcpdstat should compile just fine. Simple fix.

]]>
http://writequit.org/blog/2007/11/29/compiling-tcpdstat-on-mac-osx-quick-fix/feed/ 1