File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -510,7 +510,24 @@ public File compile(RunnerListener listener) throws Exception {
510510
511511 int gppVer = gppMajorVersion (gpp );
512512 if (gppVer > 0 && gppVer < 7 ) {
513- listener .statusError ("g++ " + gppVer + " is too old. CppMode requires GCC 7+ for C++17." );
513+ listener .statusError ("g++ " + gppVer + " is too old (need 7+). See dialog." );
514+ boolean isWin2 = isWindows ;
515+ javax .swing .SwingUtilities .invokeLater (() -> {
516+ Object [] opts = {"Update g++" , "Cancel" };
517+ int ch = javax .swing .JOptionPane .showOptionDialog (null ,
518+ "<html><b>g++ " + gppVer + " is too old.</b><br><br>"
519+ + "CppMode requires GCC 7 or newer for C++17 support.<br>"
520+ + "Your version: <b>GCC " + gppVer + "</b><br><br>"
521+ + (isWin2 ? "Click <b>Update g++</b> to download the latest portable GCC."
522+ : "Please update g++ using your system package manager." ) + "</html>" ,
523+ "g++ Too Old" ,
524+ javax .swing .JOptionPane .DEFAULT_OPTION ,
525+ javax .swing .JOptionPane .ERROR_MESSAGE ,
526+ null , opts , opts [0 ]);
527+ if (ch == 0 && isWin2 ) {
528+ try { InstallWizard .run (listener ); } catch (Exception ignored2 ) {}
529+ }
530+ });
514531 throw new Exception ("g++ too old: " + gppVer );
515532 }
516533
You can’t perform that action at this time.
0 commit comments