Fatal Error C1189:JUCE requires C++17 or later

Hello folks, I’m a newbie (c++ & Juce)

I was trying Visual Studio Extension “CodeMaid” and used “code cleanup” command. Then it overwrites some Juce (my version was 7.0.3) header files. And I couldnt build/run my project, it gave 1600 errors
(fatal error c1189 - juce requires c++ 17 or later)

So I’ve deleted & installed JUCE (the new version 7.0.4) again. It gave the same error, then I’ve installed previous version 7.0.3 but still it’s not running, error c1189

What can I do ?

Thank you very much

Do you have your project settings set to use C++17?
JUCE was changed in a recnt update to require C++17.

But Visual Studio is giving that error, I’m not using Projucer. It was ok 5 minute ago before that “CodeMaid” overwrited Juce files & my juce re-install.


It also gives that “C++17 or later” error for Microsoft Visual Studio components, as you see

|Error|C1189|#error: JUCE requires C++17 or later|ConsoleApp|C:\JUCE\modules\juce_core\system\juce_CompilerSupport.h|91||

“CodeMaid” is not part of Juce.

Apparently that, or something related to it, messed up your development tools.

Try to clean your development environment, maybe even reinstall Visual Studio.

You have not yet posted what you are actually compiling… Is it code from you, an external project, or an example from Juce?

The C++17 message is not an error that points to Juce code, which, like it says, is written using C++17 syntax. It must point to something outside of Juce, that uses an older style syntax and is thus not compliant with the latest Juce.

Success!

Hey I also had this problem, did a web search to try to find a quick solution, and this seemed to be the only relevant result. I will share a solution that worked for me so that it might save someone else some time:

I updated JUCE today and installed it to a new directory (old directory D:, new directory C:) then when I went to compile my project I got the same error as the OP (“juce requires c++ 17 or later”).

The problem seems to be that I had some my old paths (from D:\JUCE) in some of the “Global Paths”. So I changed all the paths to the new directory (C:\JUCE) and the error is no more.

TL;DR: Fixing the wrong paths in File → Global Paths… fixed this error for me.