sc-machine icon indicating copy to clipboard operation
sc-machine copied to clipboard

master doesn't build without C++17 standard enforced

Open FallenChromium opened this issue 4 years ago • 0 comments

The compiler (clang++ 13 in my case) whines that it cannot find several templates (namely: ostis-dev-sc-machine/sc-memory/sc-memory/sc_template_generate.hpp:16:23: error: no template named 'optional' in namespace 'std', ostis-dev-sc-machine/sc-memory/sc-memory/sc_template.hpp:39:15: error: no member named 'make_unique' in namespace 'std') which have been introduced in C++17 and C++14, respectively. I saw a hardcoded stdc++17 flag for multiple compilers, the problem is that on newer macOS-es or exotic compilers, this won't work. In general, it is better to use

set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

in CMake to resolve this problem (it worked for me btw).

FallenChromium avatar Nov 27 '21 11:11 FallenChromium