justniffer icon indicating copy to clipboard operation
justniffer copied to clipboard

compile error under fedora34

Open cheese1 opened this issue 3 years ago • 1 comments

fedora34 has a to modern compiler and this breaks compilation as follows:

ar -cr libnids2.a checksum.o ip_fragment.o ip_options.o killtcp.o libnids.o scan.o tcp.o util.o allpromisc.o hash.o
ranlib libnids2.a
make[2]: Leaving directory '/builddir/build/BUILD/justniffer-0.5.15/lib/libnids-1.21_patched/src'
make[1]: Leaving directory '/builddir/build/BUILD/justniffer-0.5.15/lib/libnids-1.21_patched'
Making all in src
make[1]: Entering directory '/builddir/build/BUILD/justniffer-0.5.15/src'
g++ -DHAVE_CONFIG_H -I. -I../include  -I ../lib/libnids-1.21_patched/src  -I/usr/include  -I ../include   -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
In file included from formatter.h:23,
                 from main.cpp:22:
utilities.h:76:41: error: ISO C++17 does not allow dynamic exception specifications
   76 | void check_pcap_file(const string& str) throw (invalid_pcap_file);
      |                                         ^~~~~
utilities.h:94:55: error: ISO C++17 does not allow dynamic exception specifications
   94 | template <class E> void check (bool arg1, const E& e) throw (exception)
      |                                                       ^~~~~
make[1]: Leaving directory '/builddir/build/BUILD/justniffer-0.5.15/src'
make[1]: *** [Makefile:417: main.o] Error 1

cheese1 avatar May 11 '21 19:05 cheese1

A little late to the party...

google CXX_STANDARD and dynamic exception specifications for C++17 to understand the issue.

This (set c++ std to 11) worked for me on Ubuntu 22.04.1 LTS:

apt-get install -y build-essential libboost-all-dev && \
cd /tmp && \
rm -rf /tmp/justniffer && \
git clone https://github.com/onotelli/justniffer && \
cd justniffer && \
./configure CXXFLAGS='-std=gnu++11 -g -O2 -w' && \
make && \
make install

seimnseimn avatar Dec 05 '22 12:12 seimnseimn