pcapdpi icon indicating copy to clipboard operation
pcapdpi copied to clipboard

multiple redefinition of struct errors error: redefinition of ‘struct ndpi_iphdr’

Open jsrojas opened this issue 7 years ago • 0 comments

I am working with libndpi 2.1.0.

I'm not sure how am i supposed to define the paths for 3 of these variables (INCLUDE_PATH, C_INCLUDE_PATH and LIBRARY_PATH). I know INC goes to where the library is, but where am i supposed to direct the other three?

INC=-I/usr/local/include/libndpi-2.1.0/libndpi/ -I. -I$(INCLUDE_PATH) -I$(C_INCLUDE_PATH) LIB=-L$(LIBRARY_PATH)

all: pcapDPI

pcapDPI: pcapReader.c gcc -g pcapReader.c -o pcapDPI $(INC) $(LIB) -lpcap -lndpi

clean: /bin/rm -f pcapDPI

Either way i tried the make command and first it showed that it was unable to find the libcache.h

After putting the path to the libcache.h in the include of the ndpi_typedefs.h i am getting multiple errors of redefinition. What am i doing wrong?. Thanks.

$ make gcc -g pcapReader.c -o pcapDPI -I/usr/local/include/libndpi-2.1.0/libndpi/ -I. -Ifile:/home/juan/Posgrado/Maestria/nDPI/nDPI-dev/src/lib/third_party/include -I -Lfile:/home/juan/Posgrado/Maestria/nDPI/nDPI-dev/src/lib/third_party/include -lpcap -lndpi In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:30:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_typedefs.h:124:8: error: redefinition of ‘struct ndpi_ethhdr’ struct ndpi_ethhdr ^ In file included from pcapReader.c:33:0: linux_compat.h:46:8: note: originally defined here struct ndpi_ethhdr { ^ In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:30:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_typedefs.h:186:8: error: redefinition of ‘struct ndpi_iphdr’ struct ndpi_iphdr { ^ In file included from pcapReader.c:33:0: linux_compat.h:57:8: note: originally defined here struct ndpi_iphdr { ^ In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:30:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_typedefs.h:208:8: error: redefinition of ‘struct ndpi_in6_addr’ struct ndpi_in6_addr ^ In file included from pcapReader.c:33:0: linux_compat.h:138:8: note: originally defined here struct ndpi_in6_addr { ^ In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:30:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_typedefs.h:223:12: error: redefinition of ‘struct ndpi_ip6_hdrctl’ struct ndpi_ip6_hdrctl ^ In file included from pcapReader.c:33:0: linux_compat.h:148:12: note: originally defined here struct ndpi_ip6_hdrctl { ^ In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:30:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_typedefs.h:240:8: error: redefinition of ‘struct ndpi_tcphdr’ struct ndpi_tcphdr ^ In file included from pcapReader.c:33:0: linux_compat.h:160:8: note: originally defined here struct ndpi_tcphdr { ^ In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:30:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_typedefs.h:261:8: error: redefinition of ‘struct ndpi_udphdr’ struct ndpi_udphdr ^ In file included from pcapReader.c:33:0: linux_compat.h:177:8: note: originally defined here struct ndpi_udphdr { ^ pcapReader.c: In function ‘setupDetection’: pcapReader.c:476:3: error: too many arguments to function ‘ndpi_init_detection_module’ ndpi_struct = ndpi_init_detection_module(detection_tick_resolution, malloc_wrapper, free_wrapper, debug_printf); ^ In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_api.h:141:40: note: declared here struct ndpi_detection_module_struct *ndpi_init_detection_module(void); ^ pcapReader.c: In function ‘terminateDetection’: pcapReader.c:518:3: error: too many arguments to function ‘ndpi_exit_detection_module’ ndpi_exit_detection_module(ndpi_struct, free_wrapper); ^ In file included from /usr/local/include/libndpi-2.1.0/libndpi/ndpi_main.h:31:0, from pcapReader.c:34: /usr/local/include/libndpi-2.1.0/libndpi/ndpi_api.h:170:8: note: declared here void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_struct); ^ make: *** [pcapDPI] Error 1

jsrojas avatar Nov 27 '17 14:11 jsrojas