jayrfink / netstr

Network Strings
GNU General Public License v2.0
5 stars 1 forks source link

'multiple definition" errors #1

Open nobicycle opened 3 years ago

nobicycle commented 3 years ago

Hello sir, thank you for netstr.

please find below compilation errors on the machine: $ uname -a Linux tower 5.10.7-3-MANJARO #1 SMP PREEMPT Fri Jan 15 21:11:34 UTC 2021 x86_64 GNU/Linux

$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.0 (GCC)

Regards

 make Linux
make objs DEFINES=-DLINUX
make[1]: Entering directory '/home/user/tmp/netstr-0.20'
gcc  -O3 -DLINUX netstr.c scan.c scan6.c udpscan.c passive.c tcpdump.c arpsniff.c decode.c  utils.c ipv4_conn.c "-lpcap" -o netstr
In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from ipv4_conn.h:9,
                 from passive.c:9:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
passive.c: In function ‘passive_main’:
passive.c:266:6: warning: ‘pcap_lookupdev’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
  266 |      && ((pcap_dev = pcap_lookupdev(errbuf)) == NULL)) {
      |      ^~
In file included from /usr/include/pcap.h:43,
                 from ipv4_conn.h:15,
                 from passive.c:9:
/usr/include/pcap/pcap.h:394:16: note: declared here
  394 | PCAP_API char *pcap_lookupdev(char *)
      |                ^~~~~~~~~~~~~~
In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from netstr.h:12,
                 from tcpdump.c:9:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
tcpdump.c: In function ‘tcpdump_main’:
tcpdump.c:151:26: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]
  151 |    if (optarg != NULL && isdigit(*optarg)) {
      |                          ^~~~~~~
tcpdump.c:181:6: warning: ‘pcap_lookupdev’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
  181 |      && ((pcap_dev = pcap_lookupdev(errbuf)) == NULL)) {
      |      ^~
In file included from /usr/include/pcap.h:43,
                 from netstr.h:18,
                 from tcpdump.c:9:
/usr/include/pcap/pcap.h:394:16: note: declared here
  394 | PCAP_API char *pcap_lookupdev(char *)
      |                ^~~~~~~~~~~~~~
In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from netstr.h:12,
                 from arpsniff.c:4:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
arpsniff.c: In function ‘arpsniff_main’:
arpsniff.c:105:26: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]
  105 |    if (optarg != NULL && isdigit(*optarg)) {
      |                          ^~~~~~~
arpsniff.c:135:6: warning: ‘pcap_lookupdev’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
  135 |      && ((pcap_dev = pcap_lookupdev(errbuf)) == NULL)) {
      |      ^~
In file included from /usr/include/pcap.h:43,
                 from netstr.h:18,
                 from arpsniff.c:4:
/usr/include/pcap/pcap.h:394:16: note: declared here
  394 | PCAP_API char *pcap_lookupdev(char *)
      |                ^~~~~~~~~~~~~~
decode.c: In function ‘decoder’:
decode.c:20:7: warning: implicit declaration of function ‘isprint’ [-Wimplicit-function-declaration]
   20 |   if (isprint(packet[i]))
      |       ^~~~~~~
utils.c: In function ‘u_int_check’:
utils.c:68:23: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]
   68 |  if (value != NULL && isdigit(*value)) {
      |                       ^~~~~~~
/usr/bin/ld: /tmp/ccFpsm14.o:(.bss+0x414): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccFpsm14.o:(.bss+0x416): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here
/usr/bin/ld: /tmp/ccFpsm14.o:(.bss+0x418): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/ccuFCcZ7.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccuFCcZ7.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here
/usr/bin/ld: /tmp/ccuFCcZ7.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/cc19IS28.o:(.bss+0x8): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/cc19IS28.o:(.bss+0xa): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here
/usr/bin/ld: /tmp/cc19IS28.o:(.bss+0x10): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/cc1dGDJ5.o:(.bss+0x10): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/cc1dGDJ5.o:(.bss+0x8): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/cc1dGDJ5.o:(.bss+0xa): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here
/usr/bin/ld: /tmp/ccTHmYg5.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/ccTHmYg5.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here
/usr/bin/ld: /tmp/ccTHmYg5.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/ccBI0CJ7.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here
/usr/bin/ld: /tmp/ccBI0CJ7.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here
/usr/bin/ld: /tmp/ccBI0CJ7.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/cc9rhnf8.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here
/usr/bin/ld: /tmp/cc9rhnf8.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here
/usr/bin/ld: /tmp/cc9rhnf8.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:54: netstr] Error 1
make[1]: Leaving directory '/home/user/tmp/netstr-0.20'
make: *** [Makefile:28: Linux] Error 2
jayrfink commented 3 years ago

I haven't worked on this code in a few years. Will take a look when I can thank you for the message.

J

On Mon, Feb 8, 2021 at 2:56 AM nobicycle notifications@github.com wrote:

Hello sir, thank you for netstr.

please find below compilation errors on the machine: $ uname -a Linux tower 5.10.7-3-MANJARO #1 https://github.com/jayrfink/netstr/issues/1 SMP PREEMPT Fri Jan 15 21:11:34 UTC 2021 x86_64 GNU/Linux

$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.0 (GCC)

Regards

make Linux

make objs DEFINES=-DLINUX

make[1]: Entering directory '/home/user/tmp/netstr-0.20'

gcc -O3 -DLINUX netstr.c scan.c scan6.c udpscan.c passive.c tcpdump.c arpsniff.c decode.c utils.c ipv4_conn.c "-lpcap" -o netstr

In file included from /usr/include/bits/libc-header-start.h:33,

             from /usr/include/stdio.h:27,

             from ipv4_conn.h:9,

             from passive.c:9:

/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

  |   ^~~~~~~

passive.c: In function ‘passive_main’:

passive.c:266:6: warning: ‘pcap_lookupdev’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]

266 | && ((pcap_dev = pcap_lookupdev(errbuf)) == NULL)) {

  |      ^~

In file included from /usr/include/pcap.h:43,

             from ipv4_conn.h:15,

             from passive.c:9:

/usr/include/pcap/pcap.h:394:16: note: declared here

394 | PCAP_API char pcap_lookupdev(char )

  |                ^~~~~~~~~~~~~~

In file included from /usr/include/bits/libc-header-start.h:33,

             from /usr/include/stdio.h:27,

             from netstr.h:12,

             from tcpdump.c:9:

/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

  |   ^~~~~~~

tcpdump.c: In function ‘tcpdump_main’:

tcpdump.c:151:26: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]

151 | if (optarg != NULL && isdigit(*optarg)) {

  |                          ^~~~~~~

tcpdump.c:181:6: warning: ‘pcap_lookupdev’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]

181 | && ((pcap_dev = pcap_lookupdev(errbuf)) == NULL)) {

  |      ^~

In file included from /usr/include/pcap.h:43,

             from netstr.h:18,

             from tcpdump.c:9:

/usr/include/pcap/pcap.h:394:16: note: declared here

394 | PCAP_API char pcap_lookupdev(char )

  |                ^~~~~~~~~~~~~~

In file included from /usr/include/bits/libc-header-start.h:33,

             from /usr/include/stdio.h:27,

             from netstr.h:12,

             from arpsniff.c:4:

/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

  |   ^~~~~~~

arpsniff.c: In function ‘arpsniff_main’:

arpsniff.c:105:26: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]

105 | if (optarg != NULL && isdigit(*optarg)) {

  |                          ^~~~~~~

arpsniff.c:135:6: warning: ‘pcap_lookupdev’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]

135 | && ((pcap_dev = pcap_lookupdev(errbuf)) == NULL)) {

  |      ^~

In file included from /usr/include/pcap.h:43,

             from netstr.h:18,

             from arpsniff.c:4:

/usr/include/pcap/pcap.h:394:16: note: declared here

394 | PCAP_API char pcap_lookupdev(char )

  |                ^~~~~~~~~~~~~~

decode.c: In function ‘decoder’:

decode.c:20:7: warning: implicit declaration of function ‘isprint’ [-Wimplicit-function-declaration]

20 | if (isprint(packet[i]))

  |       ^~~~~~~

utils.c: In function ‘u_int_check’:

utils.c:68:23: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]

68 | if (value != NULL && isdigit(*value)) {

  |                       ^~~~~~~

/usr/bin/ld: /tmp/ccFpsm14.o:(.bss+0x414): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here

/usr/bin/ld: /tmp/ccFpsm14.o:(.bss+0x416): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here

/usr/bin/ld: /tmp/ccFpsm14.o:(.bss+0x418): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here

/usr/bin/ld: /tmp/ccuFCcZ7.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here

/usr/bin/ld: /tmp/ccuFCcZ7.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here

/usr/bin/ld: /tmp/ccuFCcZ7.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here

/usr/bin/ld: /tmp/cc19IS28.o:(.bss+0x8): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here

/usr/bin/ld: /tmp/cc19IS28.o:(.bss+0xa): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here

/usr/bin/ld: /tmp/cc19IS28.o:(.bss+0x10): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here

/usr/bin/ld: /tmp/cc1dGDJ5.o:(.bss+0x10): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here

/usr/bin/ld: /tmp/cc1dGDJ5.o:(.bss+0x8): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here

/usr/bin/ld: /tmp/cc1dGDJ5.o:(.bss+0xa): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here

/usr/bin/ld: /tmp/ccTHmYg5.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here

/usr/bin/ld: /tmp/ccTHmYg5.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here

/usr/bin/ld: /tmp/ccTHmYg5.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here

/usr/bin/ld: /tmp/ccBI0CJ7.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here

/usr/bin/ld: /tmp/ccBI0CJ7.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here

/usr/bin/ld: /tmp/ccBI0CJ7.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here

/usr/bin/ld: /tmp/cc9rhnf8.o:(.bss+0x0): multiple definition of `pcap_decode_flag'; /tmp/cc3y4Ur6.o:(.bss+0x0): first defined here

/usr/bin/ld: /tmp/cc9rhnf8.o:(.bss+0x2): multiple definition of `pcap_proto_version'; /tmp/cc3y4Ur6.o:(.bss+0x2): first defined here

/usr/bin/ld: /tmp/cc9rhnf8.o:(.bss+0x8): multiple definition of `pcap_dev'; /tmp/cc3y4Ur6.o:(.bss+0x8): first defined here

collect2: error: ld returned 1 exit status

make[1]: *** [Makefile:54: netstr] Error 1

make[1]: Leaving directory '/home/user/tmp/netstr-0.20'

make: *** [Makefile:28: Linux] Error 2

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jayrfink/netstr/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEGBZ7LX6FPN4BQH33RBXL3S56KL5ANCNFSM4XIP5ISA .