There was an error while loading. Please reload this page.
1 parent 3fddac4 commit 2d9c6d9Copy full SHA for 2d9c6d9
1 file changed
src/Processing.cpp
@@ -3344,7 +3344,11 @@ void PApplet::run(){
3344
PDEBUG("Debug mode ON -- PApplet::run() starting\n");
3345
g_papplet = this;
3346
#ifdef _WIN32
3347
- // Prevent ios_base crash on Windows by syncing before first use
+ // CRITICAL: call sync_with_stdio before ANY iostream use on Windows.
3348
+ // MinGW 14+ has a bug where ios_base::_M_init crashes when the first
3349
+ // std::cerr/cout use happens without a console attached (-mwindows).
3350
+ // sync_with_stdio(false) bypasses the broken locale init path.
3351
+ // DO NOT add any std::cerr/cout calls before PApplet::run() is called.
3352
::std::ios_base::sync_with_stdio(false);
3353
::std::cin.tie(nullptr);
3354
#endif
0 commit comments