c++20 introduced the library, however i'm unable to use it.
this is my compile line: g++-10 -std=c++20 sem.cpp -o sem
the error that I get is:
sem.cpp:4:10: fatal error: semaphore: No such file or directory
4 | #include <semaphore>
| ^~~~~~~~~~~
compilation terminated.
I tried using a different compiler clang++
but it didn't make any difference.
Using Linux.
GCC/libstdc++ 10 lacked support for this C++20 feature.
GCC 11 (released April 2021) provides the semaphore
header file as do recent versions of Clang and MSVC.
https://en.cppreference.com/w/cpp/compiler_support
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With