cpp-io2d / P0267_RefImpl

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

[Ubuntu] Build [65%] : error: size of array ‘altStackMem’ is not an integral constant-expression #147

Open rakshitraj opened 2 years ago

rakshitraj commented 2 years ago

System Details:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 21.10
Release:    21.10
Codename:   impish
$ uname -a
Linux mBox 5.13.0-22-generic #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  1. GCC Version - gcc (Ubuntu 11.2.0-7ubuntu2) 11.2.0
  2. Cmake Version - cmake version 3.18.4

Steps to reproduce the error

Refresh apt: sudo apt update Install GCC: sudo apt install build-essential Install CMake: sudo apt install cmake Install Cairo: sudo apt install libcairo2-dev Install graphicsmagick: sudo apt install libgraphicsmagick1-dev Install libpng: sudo apt install libpng-dev Example of CMake execution:

git clone --recurse-submodules https://github.com/cpp-io2d/P0267_RefImpl
cd P0267_RefImpl
mkdir Debug
cd Debug
cmake --config Debug "-DCMAKE_BUILD_TYPE=Debug" ..
cmake --build .

Detailed Output

$ cmake --build .

Scanning dependencies of target io2d_core [ 2%] Building CXX object P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/rgba_color.cpp.o [ 4%] Building CXX object P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/xinterchangebuffer.cpp.o [ 6%] Linking CXX static library libio2d_core.a [ 6%] Built target io2d_core Scanning dependencies of target io2d_cairo [ 9%] Building CXX object P0267_RefImpl/P0267_RefImpl/cairo/CMakeFiles/io2d_cairo.dir/cairo_renderer-graphicsmagickinit.cpp.o [ 11%] Linking CXX static library libio2d_cairo.a [ 11%] Built target io2d_cairo Scanning dependencies of target io2d_cairo_xlib [ 13%] Building CXX object P0267_RefImpl/P0267_RefImpl/cairo/xlib/CMakeFiles/io2d_cairo_xlib.dir/cairo_renderer_xlib.cpp.o [ 16%] Linking CXX static library libio2d_cairo_xlib.a [ 16%] Built target io2d_cairo_xlib Scanning dependencies of target color_fill [ 18%] Building CXX object P0267_RefImpl/Samples/color_fill/CMakeFiles/color_fill.dir/main.cpp.o [ 20%] Linking CXX executable color_fill [ 20%] Built target color_fill Scanning dependencies of target cpu_load [ 23%] Building CXX object P0267_RefImpl/Samples/cpu_load/CMakeFiles/cpu_load.dir/main.cpp.o [ 25%] Building CXX object P0267_RefImpl/Samples/cpu_load/CMakeFiles/cpu_load.dir/data_source.cpp.o [ 27%] Building CXX object P0267_RefImpl/Samples/cpu_load/CMakeFiles/cpu_load.dir/profiler_linux.cpp.o [ 30%] Linking CXX executable cpu_load [ 30%] Built target cpu_load Scanning dependencies of target draw_cpp [ 32%] Building CXX object P0267_RefImpl/Samples/draw_cpp/CMakeFiles/draw_cpp.dir/main.cpp.o [ 34%] Linking CXX executable draw_cpp [ 34%] Built target draw_cpp Scanning dependencies of target life [ 37%] Building CXX object P0267_RefImpl/Samples/life/CMakeFiles/life.dir/main.cpp.o [ 39%] Linking CXX executable life [ 39%] Built target life Scanning dependencies of target rocks_in_space [ 41%] Building CXX object P0267_RefImpl/Samples/rocks_in_space/CMakeFiles/rocks_in_space.dir/Asteroid.cpp.o [ 44%] Building CXX object P0267_RefImpl/Samples/rocks_in_space/CMakeFiles/rocks_in_space.dir/Game.cpp.o [ 46%] Building CXX object P0267_RefImpl/Samples/rocks_in_space/CMakeFiles/rocks_in_space.dir/Input.cpp.o [ 48%] Building CXX object P0267_RefImpl/Samples/rocks_in_space/CMakeFiles/rocks_in_space.dir/Maths.cpp.o [ 51%] Building CXX object P0267_RefImpl/Samples/rocks_in_space/CMakeFiles/rocks_in_space.dir/Physics.cpp.o [ 53%] Building CXX object P0267_RefImpl/Samples/rocks_in_space/CMakeFiles/rocks_in_space.dir/Ship.cpp.o [ 55%] Building CXX object P0267_RefImpl/Samples/rocks_in_space/CMakeFiles/rocks_in_space.dir/LinuxMain.cpp.o [ 58%] Linking CXX executable rocks_in_space [ 58%] Built target rocks_in_space Scanning dependencies of target sprites [ 60%] Building CXX object P0267_RefImpl/Samples/sprites/CMakeFiles/sprites.dir/main.cpp.o [ 62%] Linking CXX executable sprites [ 62%] Built target sprites Scanning dependencies of target tests [ 65%] Building CXX object P0267_RefImpl/Tests/CMakeFiles/tests.dir/main.cpp.o In file included from /usr/include/signal.h:328, from /home/raxit/P0267_RefImpl/P0267_RefImpl/Tests/Catch2/single_include/catch.hpp:4716, from /home/raxit/P0267_RefImpl/P0267_RefImpl/Tests/main.cpp:15: /home/raxit/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] = {}; | ^~~~ gmake[2]: [P0267_RefImpl/Tests/CMakeFiles/tests.dir/build.make:82: P0267_RefImpl/Tests/CMakeFiles/tests.dir/main.cpp.o] Error 1 gmake[1]: [CMakeFiles/Makefile2:619: P0267_RefImpl/Tests/CMakeFiles/tests.dir/all] Error 2 gmake: *** [Makefile:160: all] Error 2

Why this issue?

After studying responses to previous similar issues, I feel like the solutions mentioned there may not be applicable to the newer ubuntu 21.10 LTS. Previous similar issues were typically solved by updating cmake or gcc to the latest version but in the case of latest ubuntu (21.10), such requirements are already fulfilled.

varomix commented 2 years ago

I just build without test -DIO2D_WITHOUT_TESTS=1

sarda23 commented 1 year ago

1 install boost lib 2 install openssl lib both from terminal

stondo commented 1 year ago

Same problem here:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy
$ uname -a
Linux pluto 5.15.0-60-generic #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
$ cmake --version
cmake version 3.22.1
/home/stondo/develop/cpp/P0267_RefImpl/P0267_RefImpl/Samples/svg/external/svgpp/include/svgpp/policy/value_events.hpp:23:16: error: no matching function for call to ‘GradientStopContext::set(svgpp::tag::attribute::stroke&, const boost::iterator_range<const char*>&, const int&)’
   23 |     context.set(tag, args...);
      |     ~~~~~~~~~~~^~~~~~~~~~~~~~

gmake[2]: *** [P0267_RefImpl/Samples/svg/CMakeFiles/svg.dir/build.make:90: P0267_RefImpl/Samples/svg/CMakeFiles/svg.dir/svg.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:559: P0267_RefImpl/Samples/svg/CMakeFiles/svg.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

I actually got it working suppressing the test like @varomix suggested and then also by manually cloning googletest release 1.11.0 in thirdparty folder as suggested here

behindmagic9 commented 1 year ago

do you find any solution, i am also facing the same problem on Ubuntu 22.04 -DIO2D_WITHOUT_TESTS=1 , with this removing the test is worse , any alterante solution

Jack012a commented 8 months ago

I just build without test -DIO2D_WITHOUT_TESTS=1

May you share with me where I can add this one into cmake?

I tried to run it through the command line argument but cmake complaint that it ignores the manual input parameter.