The ROOT interpreter crashes/closes itself on use of cin or cout

I’m more or less a beginner at programming and am not at all tech-savvy on these types of things, so the solution may be trivial. I have been learning a bit of ROOT in school (on ubuntu), so I have some idea of what to expect. Also sorry that the explanation became a bit messy.

First some setup:
I have been struggling the last few days getting ROOT (6.19/02) up and running, mainly because the .exe version gave the error that a (unspecified) PATH was too long.
I then tried to bypass this through installing it from source ( Despite some struggle (I didn’t have git, something that took some time to realise it needed. Also used a totally fresh Visual Studio version 16.6.1 install), it was successfully compiled without errors. I also added the ‘\bin’ and ‘\include’ to the system variable PATH.
When opening cmd, switching to my work folder (or any other folder), I can type root and start it without any warning or errors.

What works:
Everything with a few exceptions. The object browser works just fine, so it is easy to execute the tutorials to see that most things work.

What doesn’t work:
First note that when an ‘invalid’ action happens root freezing a moment (<1s) before exiting without any warning or error message leaving you in the folder you started root from.

cout don’t seem to work at all. No matter if the thing you try to print is a number, char or string it closes root. (Note that printf seems to work as normal.)
cin mostly don’t work. It manages to accept specifically ‘char’ and ‘double’, but exit root if tried to use with integers or strings.

Other functions I found don’t work through blind testing of tutorials:
TLorentzVector from physics/PhaseSpace.C

Coaca/flower.C didn’t work. When pasting its content into the root interpreter I got the error message
ROOT_prompt_32:1:11: note: 'Assertion failed: isSingleDecl() && "Isn't a single decl", file C:\root\root-6.19.02\interpreter\llvm\src\tools\clang\include\clang/AST/DeclGroup.h, line 87
before root exited, but that might just be because it didn’t like unnamed namespaces

Something in gui/buttonChaneLabel.C, as that crashed root. Just say the word if more/specific examples are required.

Does anyone have any clue what could be the cause of this?
In advance thanks.

ROOT Version: 6.19/02
Platform: Windows 10
Compiler: Not Provided (Visual Studio version 16.6.1, if that is the question)

Edit: Tried ROOT version 6.20/04, and it has the exact same problems.

I just updated to Visual Studio v16.6.1,and I see there are several issue with this new version. I will need more time to figure out what’s going wrong with it (there are new issues at every new version of Visual Studio…). It might be due to incompatibilities between Visual Studio and LLVM/Clang used inside ROOT

BTW, you should try a more recent version of ROOT, several issues have been fixed since 6.19/02

I ended up with 6.19 because it is the latest one with a non-preview .exe version and not changing when the .exe didn’t work.

Is it possible to make root from source (the newest version, of course from and to separate folders) without messing up the version already working? And just change the system variable PATH to link the ‘root’ command to the new one? If not, what is required to use the new one?
Again thanks.

FYI there will be a new version today/beginning of next week. And yes, you can download the zip version, and execute the thisroot.bat script (which is in the bin directory) to set-up the environment variable for this particular version, and valid for the current command prompt session only

A new (possible) symptom of the problem:
ROOT often stops working when i try to use tab to auto-complete commands in the interpreter. This gives the error:
Error 6 in textinput::TerminalDisplayWin writing to output: The handle is invalid.
Still using the same setup as the original post, but there is a newer version of ROOT (6.20/04) currently compiling in the background.

Thought I could mention it in case it is relevant.

I think that was fixed and should not be an issue anymore in the coming release (6.22)