Do you literally have
#
in # set(CMAKE_CXX_STANDARD 17)
? #
makes it a comment. Also GCC 9 is quite old, even if it supports <optional>
updating is a good idea.