restbed
restbed copied to clipboard
MINSIGSTKSZ error during building
in the installation phase called "Building CXX object test/unit/CMakeFiles/uri_unit_test_suite.dir/source/uri_suite.cpp.o" i have this error :
In file included from /usr/include/signal.h:328,
from /home/mattia/Sviluppo/restbed/dependency/catch/single_include/catch2/catch.hpp:7955,
from /home/mattia/Sviluppo/restbed/test/unit/source/uri_suite.cpp:10:
/home/mattia/Sviluppo/restbed/dependency/catch/single_include/catch2/catch.hpp:10735:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10735 | static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
| ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
640 | extern long int sysconf (int __name) __THROW;
| ^~~~~~~
/home/mattia/Sviluppo/restbed/dependency/catch/single_include/catch2/catch.hpp:10794:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10794 | char FatalConditionHandler::altStackMem[sigStackSize] = {};
| ^~~~~~~~~~~~
make[2]: *** [test/unit/CMakeFiles/uri_unit_test_suite.dir/build.make:76: test/unit/CMakeFiles/uri_unit_test_suite.dir/source/uri_suite.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:432: test/unit/CMakeFiles/uri_unit_test_suite.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
can anyone help me? i'm using Ubuntu 22.04.1 LTS and gcc/g++ 12
I solved it by editing the catch.hpp file as shown here:
https://github.com/catchorg/Catch2/blob/d71b4617e9935f8589870af211f5b7552d743654/single_include/catch2/catch.hpp#L10818
To be more precise I replaced the code in
/home/workspace/restbed/dependency/catch/single_include/catch2/catch.hpp
with the code from the file that @mattiadido95 mentioned.