zecure / shadowd

The Shadow Daemon web application firewall server
GNU General Public License v2.0
295 stars 39 forks source link

Compiling error #78

Closed mamadouyacine closed 2 years ago

mamadouyacine commented 2 years ago

Hi, could someone help. I'm compiling from source with Debian 11. cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE=Release .. ===> passed with no error but it stack on : make shadowd here is the error I'm getting:

Scanning dependencies of target shadowd [ 3%] Building CXX object src/CMakeFiles/shadowd.dir/blacklist_filter.cpp.o [ 6%] Building CXX object src/CMakeFiles/shadowd.dir/cache.cpp.o [ 9%] Building CXX object src/CMakeFiles/shadowd.dir/config.cpp.o [ 12%] Building CXX object src/CMakeFiles/shadowd.dir/daemon.cpp.o [ 16%] Building CXX object src/CMakeFiles/shadowd.dir/log.cpp.o [ 19%] Building CXX object src/CMakeFiles/shadowd.dir/profile.cpp.o [ 22%] Building CXX object src/CMakeFiles/shadowd.dir/reply_handler.cpp.o [ 25%] Building CXX object src/CMakeFiles/shadowd.dir/request_handler.cpp.o /home/talibe/shadowd/src/request_handler.cpp: In member function ‘bool swd::request_handler::valid_signature() const’: /home/talibe/shadowd/src/request_handler.cpp:58:20: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive] 58 | (const byte )key.c_str(), | ^~~~ /home/talibe/shadowd/src/request_handler.cpp:58:14: error: expected primary-expression before ‘const’ 58 | (const byte )key.c_str(), | ^~~~~ /home/talibe/shadowd/src/request_handler.cpp:58:14: error: expected ‘)’ before ‘const’ 58 | (const byte )key.c_str(), | ~^~~~~ | ) /home/talibe/shadowd/src/request_handler.cpp:81:42: error: ‘byte’ was not declared in this scope 81 | new CryptoPP::ArraySink((byte)&result, sizeof(result)), | ^~~~ /home/talibe/shadowd/src/request_handler.cpp:81:42: note: suggested alternatives: In file included from /usr/include/cryptopp/config_cxx.h:120, from /usr/include/cryptopp/config_align.h:27, from /usr/include/cryptopp/config.h:22, from /usr/include/cryptopp/seckey.h:9, from /usr/include/cryptopp/hmac.h:9, from /home/talibe/shadowd/src/request_handler.cpp:32: /usr/include/c++/10/cstddef:69:14: note: ‘std::byte’ 69 | enum class byte : unsigned char {}; | ^~~~ In file included from /usr/include/cryptopp/config.h:27, from /usr/include/cryptopp/seckey.h:9, from /usr/include/cryptopp/hmac.h:9, from /home/talibe/shadowd/src/request_handler.cpp:32: /usr/include/cryptopp/config_int.h:56:23: note: ‘CryptoPP::byte’ 56 | typedef unsigned char byte; | ^~~~ /home/talibe/shadowd/src/request_handler.cpp:81:47: error: expected primary-expression before ‘)’ token 81 | new CryptoPP::ArraySink((byte*)&result, sizeof(result)), | ^ make[3]: [src/CMakeFiles/shadowd.dir/build.make:173: src/CMakeFiles/shadowd.dir/request_handler.cpp.o] Error 1 make[2]: [CMakeFiles/Makefile2:155: src/CMakeFiles/shadowd.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:162: src/CMakeFiles/shadowd.dir/rule] Error 2 make: [Makefile:194: shadowd] Error 2

zit-hb commented 2 years ago

Hello @mamadouyacine ,

Thanks for reporting this! It is caused by the introduction of std::byte. The byte that is used here comes from Crypto++. It is explained in more detail here: https://www.cryptopp.com/wiki/Std::byte

I have introduced a quick fix for now in the dev branch, so to compile it run git checkout dev && git pull origin dev first.

mamadouyacine commented 2 years ago

Thank you @zit-hb, it fixed the issue. shdaowd compiled & installed successfully