cpp-io2d / P0267_RefImpl

Reference Implementations of P0267, the proposed 2D graphics API for ISO C++
Other
313 stars 114 forks source link

Fail to build in arch linux: size of array ‘altStackMem’ is not an integral constant-expression #149

Open augusto-mantilla opened 2 years ago

augusto-mantilla commented 2 years ago
$ cmake --build .
...
[ 65%] Building CXX object P0267_RefImpl/Tests/CMakeFiles/tests.dir/main.cpp.o
In file included from /usr/include/signal.h:328,
                 from /home/augusto/Documents/cpp/P0267_RefImpl/P0267_RefImpl/Tests/Catch2/single_include/catch.hpp:4716,
                 from /home/augusto/Documents/cpp/P0267_RefImpl/P0267_RefImpl/Tests/main.cpp:15:
/home/augusto/Documents/cpp/P0267_RefImpl/P0267_RefImpl/Tests/Catch2/single_include/catch.hpp:7320:45: error: size of array ‘altStackMem’ is not an integral constant-expression
 7320 |     char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
      |                                             ^~~~~~~~
make[2]: *** [P0267_RefImpl/Tests/CMakeFiles/tests.dir/build.make:76: P0267_RefImpl/Tests/CMakeFiles/tests.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:559: P0267_RefImpl/Tests/CMakeFiles/tests.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

gcc (GCC) 11.2.0 cmake version 3.22.3 GNU Make 4.3

xiongyu1988 commented 2 years ago

I have got the same issue.

Not sure how to solve it.

varomix commented 2 years ago

I built without tests -DIO2D_WITHOUT_TESTS=1

sarda23 commented 1 year ago

I built without tests -DIO2D_WITHOUT_TESTS=1

how did you did this. can u tell the steps with commands

matt-tony commented 1 year ago

Try to add it as a parameter to the cmake call. However, generally speaking, it is a bad idea to build without tests, imho...

dsardelic commented 7 months ago

I built without tests -DIO2D_WITHOUT_TESTS=1

how did you did this. can u tell the steps with commands

E.g. for building on Linux replace the line cmake --config Debug "-DCMAKE_BUILD_TYPE=Debug" .. with cmake --config Debug "-DCMAKE_BUILD_TYPE=Debug" -DIO2D_WITHOUT_TESTS=1 ..

I'm fairly new at this, but I find it silly that, even though this does the trick, CMake is nevertheless giving me a warning that Manually-specified variables were not used by the project: IO2D_WITHOUT_TESTS.