I am trying to compile a program with #include <coroutine>
header file included in it. But gcc10 throws an error
/usr/include/c++/10/coroutine:295:2: error: #error "the coroutine header requires -fcoroutines"
295 | #error "the coroutine header requires -fcoroutines"
I set all the necessary flags in cmake
cmake_minimum_required(VERSION 3.17)
project(cortest1)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "-fcoroutines")
set(CMAKE_CXX_FLAGS "-pthread")
add_executable(cortest1 main.cpp)
But the compiler doesn't see the -fcoroutines flag. I am using g ++ 10.2.0