0

I'm new and started to study computer science. My issue is that we are coding in Ubuntu with clang and my code dont want to compile.

It says:

inline variables are a c++17 extension [-Wc++17-extensions]

So I gooogled it and did not found any solution how to set it on version 17. I think it is how it will be fixed. So how exactly do i set clang to default to C++ v 17?

Thanks for any kind of help!

Did write some things I found on google and dont know what was wrong, because I dont know what I'm doing.

drescherjm
  • 10,365
  • 5
  • 44
  • 64
Cookie
  • 1
  • 1
    Pass `-std=c++17` as a compiler switch - live - https://godbolt.org/z/GfTx6j5Tx – Richard Critten Dec 01 '22 at 20:42
  • 1
    Add `-std=c++17` to the flags. Or better `-std=c++20`, plus `-Wall -Wextra -pedantic-errors` to enable warnings and strict error checking. – HolyBlackCat Dec 01 '22 at 20:43
  • This question should help: [https://stackoverflow.com/questions/57557959/do-i-need-to-type-std-c17-or-whichever-standard-i-want-to-use-every-time-i](https://stackoverflow.com/questions/57557959/do-i-need-to-type-std-c17-or-whichever-standard-i-want-to-use-every-time-i) – drescherjm Dec 01 '22 at 20:43

0 Answers0