cpp-io2d / P0267_RefImpl

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

Not building on ubuntu 16.04 #126

Open karyuv opened 4 years ago

karyuv commented 4 years ago

I am trying to compile I02D and it has some issues in the cmake.

Scanning dependencies of target io2d_core [ 2%] Building CXX object P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/rgba_color.cpp.o In file included from /home/karthik/catkin_ws/c++_nanodegree/project_planner/P0267_RefImpl/P0267_RefImpl/P0267_RefImpl/rgba_color.cpp:1:0: /home/karthik/catkin_ws/c++_nanodegree/project_planner/P0267_RefImpl/P0267_RefImpl/P0267_RefImpl/xio2d.h:18:19: fatal error: variant: No such file or directory compilation terminated. P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/build.make:62: recipe for target 'P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/rgba_color.cpp.o' failed make[2]: *** [P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/rgba_color.cpp.o] Error 1 CMakeFiles/Makefile2:341: recipe for target 'P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/all' failed make[1]: *** [P0267_RefImpl/P0267_RefImpl/CMakeFiles/io2d_core.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2

Clearly the xio2d.h is in the corresponding folder, but it is not able to find it still. I am on ubuntu 16.04.

z1yuan commented 4 years ago

what is your gcc version? io2d need c++17 /1/ gcc --version

The gcc in ubuntu 16.04 is 5 by default. You might need to upgrade it first. You can find howto here /2/

I have tested, it works once gcc greater than 7.4.0.

ref /1/ https://github.com/cpp-io2d/P0267_RefImpl/blob/master/BUILDING.md /2/ how to upgrade gcc https://unix.stackexchange.com/a/548118/378454

Jensssen commented 4 years ago

Switching to gcc7 via "sudo update-alternatives --config gcc" (if you have multiple versions on your pc) solved the issue for me aswell.