Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade C++ compiler version #28

Open
rohitpaulk opened this issue Jan 30, 2024 · 4 comments
Open

Upgrade C++ compiler version #28

rohitpaulk opened this issue Jan 30, 2024 · 4 comments

Comments

@rohitpaulk
Copy link
Member

(Using C++)

I tried to use std::format but it looks like you have an older compiler on here.

Thanks to @shawlynot for reporting this!

@rohitpaulk
Copy link
Member Author

The std::format function was introduced in the C++20 standard[3]. However, the actual support for this feature in compilers came later. The GCC compiler started supporting std::format from version 13, which was released in April 2023[1][4]. For the Clang compiler, std::format support was added in version 14, but it was marked as an incomplete feature. Full support was available from Clang 15.0.0 and later, which could be enabled with the -fexperimental-library compiler flag[1]. For MSVC, support for std::format was available from version 16.10 and upward[1].

Citations:
[1] https://stackoverflow.com/questions/63724059/does-gcc-support-c20-stdformat
[2] https://en.wikipedia.org/wiki/C%2B%2B
[3] https://en.wikipedia.org/wiki/C%2B%2B20
[4] https://developers.redhat.com/articles/2023/06/21/new-c-features-gcc-13
[5] https://gcc.gnu.org/projects/cxx-status.html
[6] https://en.cppreference.com/w/cpp/compiler_support
[7] https://gcc.gnu.org/gcc-13/changes.html
[8] https://en.cppreference.com/w/cpp/language/history

@rohitpaulk
Copy link
Member Author

We're running gcc 12.x - so I'm guessing updating to 13.x should fix it?

@rohitpaulk
Copy link
Member Author

Let's update gcc across all challenges while we're at it

@shawlynot
Copy link

shawlynot commented Jan 30, 2024

We're running gcc 12.x - so I'm guessing updating to 13.x should fix it?

That fixed it for me. Also, I'm not sure what you guys use for your back end, but I needed to either upgrade my WSL Ubuntu 22 or use the bundled libstdc++ in gcc 13 (I went with the latter and I don't actually know what I'm doing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants