snort3/snort3_extra

Compiling error on CentOS 8: function marked ‘override’, but does not override

Closed this issue · 2 comments

Hello,
There occurred two errors when I tried to build snort3_extra on CentOS 8. I followed the instructions from snort-3-0-3-on-centos8, and installed snort3 without problem.
However, when I tried to also install the snort_extra, it couldn't finished compiling.

My building procedures are as follows:

  1. $ git clone https://github.com/snort3/snort3_extra.git

Cloning into 'snort3_extra'...
remote: Enumerating objects: 586, done.
remote: Counting objects: 100% (586/586), done.
remote: Compressing objects: 100% (339/339), done.
remote: Total 3765 (delta 348), reused 465 (delta 245), pack-reused 3179
Receiving objects: 100% (3765/3765), 726.58 KiB | 109.00 KiB/s, done.
Resolving deltas: 100% (2516/2516), done.

  1. $ export PKG_CONFIG_PATH=/usr/local/snort/lib64/pkgconfig:$PKG_CONFIG_PATH

$ echo $PKG_CONFIG_PATH
/usr/local/snort/lib64/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:

  1. ./configure_cmake.sh --prefix=/usr/local/snort/extra

Build Directory : build
Source Directory: /home/snrt/sources/snort3_extra
-- The CXX compiler identification is GNU 8.3.1
-- The C compiler identification is GNU 8.3.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
-- Checking for one of the modules 'snort>=3'

snort_extra version 1.0.0
Install options:
prefix: /usr/local/snort/extra
Compiler options:
CC: /usr/bin/cc
CXX: /usr/bin/c++
CFLAGS: -O3 -I/usr/local/include -I/usr/include/luajit-2.1 -I/usr/include -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include/uuid -DNDEBUG -g -ggdb
CXXFLAGS: -O3 -fno-rtti -I/usr/local/include -I/usr/include/luajit-2.1 -I/usr/include -I/usr/local/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include/uuid -DNDEBUG -g -ggdb
EXE_LDFLAGS:
MODULE_LDFLAGS:
-- Configuring done
-- Generating done
-- Build files have been written to: /home/snrt/sources/snort3_extra/build

  1. $ cd build/ && make -j$(nproc)
    and here comes the errors:

[ 96%] Linking CXX shared module lowmem.so
[ 96%] Built target sid_18758
Scanning dependencies of target tp_appid_example
[ 98%] Building CXX object src/tp_appid/CMakeFiles/tp_appid_example.dir/tp_appid_example.cc.o
[ 98%] Built target lowmem
/home/snrt/sources/snort3_extra/src/tp_appid/tp_appid_example.cc:71:10: error: ‘bool ThirdPartyAppIdContextImpl::tfini(bool)’ marked ‘override’, but does not override
bool tfini(bool) override
^~~~~
/home/snrt/sources/snort3_extra/src/tp_appid/tp_appid_example.cc: In function ‘ThirdPartyAppIdContextImpl* tp_appid_create_ctxt(ThirdPartyConfig&)’:
/home/snrt/sources/snort3_extra/src/tp_appid/tp_appid_example.cc:127:95: error: invalid new-expression of abstract class type ‘ThirdPartyAppIdContextImpl’
w ThirdPartyAppIdContextImpl(THIRD_PARTY_APPID_API_VERSION,"third party", cfg);
^
/home/snrt/sources/snort3_extra/src/tp_appid/tp_appid_example.cc:49:7: note: because the following virtual functions are pure within ‘ThirdPartyAppIdContextImpl’:
class ThirdPartyAppIdContextImpl : public ThirdPartyAppIdContext
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/snrt/sources/snort3_extra/src/tp_appid/tp_appid_example.cc:41:
/usr/local/snort/include/snort/network_inspectors/appid/tp_appid_module_api.h:63:18: note: ‘virtual bool ThirdPartyAppIdContext::tfini(bool, bool)’
virtual bool tfini(bool reload = false, bool is_idling = false) = 0;
^~~~~
make[2]: *** [src/tp_appid/CMakeFiles/tp_appid_example.dir/build.make:63: src/tp_appid/CMakeFiles/tp_appid_example.dir/tp_appid_example.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1664: src/tp_appid/CMakeFiles/tp_appid_example.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

It seems to me these are c++ syntax errors instead of any library dependency issue.

Thanks for your help!

Xiche commented

I had missed pushing out the updates for snort3_extra. Please try with the latest and let me know if that fixes it for you.

It fixed the issue, now it compiled without problem, thanks!