Can PROS use C++17?

Hey, title is self explanatory. Am itching to use some libraries but they all use C++17 functions to differing capacity. And it’s quite tedious to fix 32-120 errors PER library, which is what I’m dealing with in Vexcode. With PROS, I know it’s open source and you can use any IDE and all that good good, but I’m actually not sure if you can use C++ 17,

1 Like

Yes, I have been using C++17 for a while with pros. You can even use C++20 but it will give some warnings if you use Okapi because of some deprecated features (it still works tho™)

In your PROS project root (the base folder), there should be a file called common.mk. Look for a line like this:

CXXFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=gnu++11

In my file it is line 28.

Change it to use your desired C++ standard:

CXXFLAGS=$(MFLAGS) $(CPPFLAGS) $(WARNFLAGS) $(GCCFLAGS) --std=gnu++20

I think this file might be overwritten when PROS updates, so watch out for that.

Extra Modern C++ Goodies

Cool features in C++20 honorable mentions:
Mathmatical Constants
Coroutine
Consteval
Constexpr Improvments
Likely & Unlikely

Also all the modern C++

7 Likes

Thank you VERY much. That solves many of my problems.

1 Like