Project

General

Profile

Actions

Bug #630

closed

Suricata 1.3.4 and 1.4beta3 fails to build on Windows

Added by Peter Manev over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

compiling with (under CYGWIN) :

 libtoolize -c && autoreconf -fv --install && ./configure --disable-gccmarch-native && make clean && make

on win7 64bit
make[4]: Entering directory `/home/DonPedro/tmp/suricata-1.3.4/libhtp/test'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/home/DonPedro/tmp/suricata-1.3.4/libhtp/test'
make[4]: Entering directory `/home/DonPedro/tmp/suricata-1.3.4/libhtp'
make[4]: Leaving directory `/home/DonPedro/tmp/suricata-1.3.4/libhtp'
make[3]: Leaving directory `/home/DonPedro/tmp/suricata-1.3.4/libhtp'
make[2]: Leaving directory `/home/DonPedro/tmp/suricata-1.3.4/libhtp'
Making all in src
make[2]: Entering directory `/home/DonPedro/tmp/suricata-1.3.4/src'
make  all-am
make[3]: Entering directory `/home/DonPedro/tmp/suricata-1.3.4/src'
gcc -DHAVE_CONFIG_H -I. -I..  -I../libhtp     -g -O2 -DRELEASE -Wextra -Wall -fno-strict-aliasing -fno-tree-pre -Wno-unused-parameter -std=gnu99 -DLIBPCAP_VERSION_MAJOR=1 -DHAVE_PCAP_SET_BUFF -MT suricata.o -MD -MP -MF .deps/suricata.Tpo -c -o suricata.o suricata.c
In file included from /usr/include/pcap-stdinc.h:49:0,
                 from /usr/include/pcap/pcap.h:41,
                 from /usr/include/pcap.h:45,
                 from suricata-common.h:135,
                 from suricata.c:24:
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:103:2: warning: #warning "fd_set and associated macros have been defined in sys/types.      This may cause runtime problems with W32 sockets" 
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:120:9: error: redefinition of ‘struct hostent’
/usr/include/netdb.h:79:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:128:8: error: redefinition of ‘struct linger’
/usr/include/cygwin/socket.h:59:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:155:8: error: redefinition of ‘struct netent’
/usr/include/netdb.h:93:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:161:9: error: redefinition of ‘struct servent’
/usr/include/sys/socket.h:53:10: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:167:9: error: redefinition of ‘struct protoent’
/usr/include/netdb.h:107:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:223:8: error: redefinition of ‘struct in_addr’
/usr/include/cygwin/in.h:114:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:254:8: error: redefinition of ‘struct sockaddr_in’
/usr/include/cygwin/in.h:183:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:336:8: error: redefinition of ‘struct sockaddr’
/usr/include/cygwin/socket.h:29:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:356:8: error: redefinition of ‘struct sockaddr_storage’
/usr/include/cygwin/socket.h:41:8: note: originally defined here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:536:35: error: conflicting types for ‘accept’
/usr/include/sys/socket.h:30:7: note: previous declaration of ‘accept’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:537:32: error: conflicting types for ‘bind’
/usr/include/sys/socket.h:32:7: note: previous declaration of ‘bind’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:539:32: error: conflicting types for ‘connect’
/usr/include/sys/socket.h:33:7: note: previous declaration of ‘connect’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:541:32: error: conflicting types for ‘getpeername’
/usr/include/sys/socket.h:34:7: note: previous declaration of ‘getpeername’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:542:32: error: conflicting types for ‘getsockname’
/usr/include/sys/socket.h:35:7: note: previous declaration of ‘getsockname’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:543:32: error: conflicting types for ‘getsockopt’
/usr/include/sys/socket.h:47:7: note: previous declaration of ‘getsockopt’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:544:42: error: conflicting types for ‘inet_addr’
/usr/include/arpa/inet.h:22:11: note: previous declaration of ‘inet_addr’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:545:47: error: conflicting types for ‘inet_ntoa’
/usr/include/arpa/inet.h:28:7: note: previous declaration of ‘inet_ntoa’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:546:32: error: conflicting types for ‘listen’
/usr/include/sys/socket.h:36:7: note: previous declaration of ‘listen’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:547:32: error: conflicting types for ‘recv’
/usr/include/sys/socket.h:37:11: note: previous declaration of ‘recv’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:548:32: error: conflicting types for ‘recvfrom’
/usr/include/sys/socket.h:38:11: note: previous declaration of ‘recvfrom’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:549:32: error: conflicting types for ‘send’
/usr/include/sys/socket.h:41:11: note: previous declaration of ‘send’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:550:32: error: conflicting types for ‘sendto’
/usr/include/sys/socket.h:43:11: note: previous declaration of ‘sendto’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:551:32: error: conflicting types for ‘setsockopt’
/usr/include/sys/socket.h:45:7: note: previous declaration of ‘setsockopt’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:552:32: error: conflicting types for ‘shutdown’
/usr/include/sys/socket.h:49:7: note: previous declaration of ‘shutdown’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:553:35: error: conflicting types for ‘socket’
/usr/include/sys/socket.h:50:7: note: previous declaration of ‘socket’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:554:57: error: conflicting types for ‘gethostbyaddr’
/usr/include/netdb.h:192:17: note: previous declaration of ‘gethostbyaddr’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:555:57: error: conflicting types for ‘gethostbyname’
/usr/include/netdb.h:193:17: note: previous declaration of ‘gethostbyname’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:556:57: error: conflicting types for ‘getservbyport’
/usr/include/netdb.h:203:17: note: previous declaration of ‘getservbyport’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:557:57: error: conflicting types for ‘getservbyname’
/usr/include/netdb.h:202:17: note: previous declaration of ‘getservbyname’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:558:58: error: conflicting types for ‘getprotobynumber’
/usr/include/netdb.h:200:18: note: previous declaration of ‘getprotobynumber’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:559:58: error: conflicting types for ‘getprotobyname’
/usr/include/netdb.h:199:18: note: previous declaration of ‘getprotobyname’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:628:35: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:628:35: error: expected ‘)’ before ‘?’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:629:35: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:629:35: error: expected ‘)’ before ‘?’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:630:36: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:630:36: error: expected ‘)’ before ‘?’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:631:36: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:631:36: error: expected ‘)’ before ‘?’ token
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:632:32: error: conflicting types for ‘select’
/usr/include/sys/select.h:31:5: note: previous declaration of ‘select’ was here
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winsock2.h:635:12: error: conflicting types for ‘gethostname’
/usr/include/sys/unistd.h:238:6: note: previous declaration of ‘gethostname’ was here
In file included from /usr/include/pcap/pcap.h:41:0,
                 from /usr/include/pcap.h:45,
                 from suricata-common.h:135,
                 from suricata.c:24:
/usr/include/pcap-stdinc.h:58:22: fatal error: IP6_misc.h: No such file or directory
compilation terminated.
Makefile:1171: recipe for target `suricata.o' failed
make[3]: *** [suricata.o] Error 1
make[3]: Leaving directory `/home/DonPedro/tmp/suricata-1.3.4/src'
Makefile:787: recipe for target `all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/DonPedro/tmp/suricata-1.3.4/src'
Makefile:339: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/DonPedro/tmp/suricata-1.3.4'
Makefile:268: recipe for target `all' failed
make: *** [all] Error 2

Actions #1

Updated by Victor Julien over 11 years ago

  • Status changed from New to Closed
  • Assignee set to Victor Julien
  • Target version set to 1.3.5
  • % Done changed from 0 to 100

Fixed in:

commit b7fac593fed30fbd00f68cd07a37c05bd7b5f6e5
Author: Victor Julien <victor@inliniac.net>
Date:   Thu Nov 15 12:13:53 2012 +0100

    build: reshuffle including headers to fix build on cygwin

The fix is:

diff --git a/src/suricata-common.h b/src/suricata-common.h
index 09385f1..3d2a14f 100644
--- a/src/suricata-common.h
+++ b/src/suricata-common.h
@@ -113,6 +113,14 @@
 #include <netdb.h>
 #endif

+#ifdef HAVE_PCAP_H
+#include <pcap.h>
+#endif
+
+#ifdef HAVE_PCAP_PCAP_H
+#include <pcap/pcap.h>
+#endif
+
 #ifdef HAVE_WINDOWS_H
 #ifndef _WIN32_WINNT
 #define _WIN32_WINNT 0x0501
@@ -131,14 +139,6 @@
 #include <assert.h>
 #define BUG_ON(x) assert(!(x))

-#ifdef HAVE_PCAP_H
-#include <pcap.h>
-#endif
-
-#ifdef HAVE_PCAP_PCAP_H
-#include <pcap/pcap.h>
-#endif
-
 /* we need this to stringify the defines which are supplied at compiletime see:
    http://gcc.gnu.org/onlinedocs/gcc-3.4.1/cpp/Stringification.html#Stringification */
 #define xstr(s) str(s)

Actions

Also available in: Atom PDF