Root on Windows breaks for simple loops

_ROOT Version:ROOT 6.24/00
_Platform:Windows 10
_Compiler:installation through executable


Is it just me, or does root not work properly on windows. Unfortunately I cannot use Linux on my laptop. Since years I’m trying it from time to time, hoping somebody fixes it.

Example: I create a file with a simple loop in it:

void Analyze_Data()
{
	for(int i= 0; i < 10; i++)
	{
		cout << i << endl;
	}
}

running it with “root -l Analyze_Data.C” ends with root breaking without any further information.

I can start a TCanvas, I can read data Through TTree. But loops keep breaking root.

Welcome to the ROOT Forum!
It works just fine for me:

C:\Users\bellenot\rootdev>root Analyze_Data.cxx
   ------------------------------------------------------------------
  | Welcome to ROOT 6.24/00                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win32 on Apr 14 2021, 14:33:50                         |
  | From tags/v6-24-00@v6-24-00                                      |
  | With MSVC 19.23.28107.0                                          |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0]
Processing Analyze_Data.cxx...
0
1
2
3
4
5
6
7
8
9
root [1]

But it might be due to the << endl statement. Try to replace it with << "\n"

Thanks for the quick response. So I will keep looking on the configuration of my laptop and compare it with another windows machine. The “\n” did not help.

Unfortunately I cannot use Linux on my laptop.

In addition to the Windows build, ROOT also works very well under WSL2 (for example running an Ubuntu distribution)