# I/o streams problem (windows 7)

**URL:** <https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657>\
**Category:** Newbie\
**Created:** [July 2, 2021, 10:23am UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657 "2021-07-02T10:23:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bloop](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bloop](https://root-forum.cern.ch/u/bloop)\
**Post date:** [July 2, 2021, 10:23am UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/1 "2021-07-02T10:23:47Z")

</div>

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ v6.24.02  
_Platform:_ Windows 7  
_Compiler:_ MSVC 19.23.28107.0

* * *

Good day, everybody.

My problem is similar to [rajliv](https://root-forum.cern.ch/t/the-root-interpreter-crashes-closes-itself-on-use-of-cin-or-cout/39765).

I have installed [a pre-compiled binary distribution of ROOT for Windows](https://root.cern/releases/release-62402/). Then I type (using x86 Native Tools Command Prompt for VS 2019):

```auto
root [0] int x = 10
root [1] cout << x

```

Then crash. By the way, I can get a char-type variable via cout:

```auto
root [0] char y = 'a'
root [1] cout << y

```

The last sequence of commands proceeds fine (see the screenshot).

The issue is not limited to cout command, I have troubles with i/o in general. For example, **ifstream infile(“_here is a file name_”)** doesn’t go well.

Probably Windows 7 is not supported by the current ROOT version? Should I use older versions?

![sh_root](https://root-forum.cern.ch/uploads/default/original/3X/5/b/5be188ca3ee8ed82f9466e35d9acf7466dc71142.jpeg).

The strange detail is that **cout \>\> _[here are non-char-type variables]_** proceeds okay on rare occassions (code is same). No clue what does it depends on.

Thank you for your attention.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 2, 2021, 11:23am UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/2 "2021-07-02T11:23:33Z")

</div>

It might be due to an incompatibility between your version of Visual Studio (16.10.3) and the one used to build ROOT (v16.3.10). I see no problem with ROOT v6.24.02 on a machine with VS v16.4.6:

```auto
C:\Users\bellenot\Downloads>root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.24/02 https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win32 on Jun 28 2021, 09:28:51 |
  | From tags/v6-24-02@v6-24-02 |
  | With MSVC 19.23.28107.0 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

root [0] int x = 10;
root [1] cout << x;
10
root [2] char y = 'a';
root [3] cout << y;
a
root [4]

```

---

<div class="post-metadata">

**Author:** ![bloop](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bloop](https://root-forum.cern.ch/u/bloop)\
**Post date:** [July 2, 2021, 2:35pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/3 "2021-07-02T14:35:42Z")

</div>

Thanks, I’ll try to build from source.

---

<div class="post-metadata">

**Author:** ![bloop](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bloop](https://root-forum.cern.ch/u/bloop)\
**Post date:** [July 5, 2021, 1:37pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/4 "2021-07-05T13:37:45Z")

</div>

Building ROOT v6.24.02 with VS v16.10.3 (MSVC v19.23.28107.0) didn’t proceed well too. I used commands:

```auto
cmake -G"Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX="../root_install" "../root_source"
cmake --build . --config Release --target install

```

I could execute root.exe but typing _cout \<\< 5_ still caused a crash.

See the screenshots and CMakeCache.txt:

[CMakeCache.txt](https://root-forum.cern.ch/uploads/short-url/yOyhtYgs4heMNDsGSBciwg8FiPK.txt) (121.3 KB)

 ![2sh1](https://root-forum.cern.ch/uploads/default/original/3X/8/f/8fea5003e88cbc235108188551ca0a8ec206a9fa.jpeg)  
 ![2sh2](https://root-forum.cern.ch/uploads/default/original/3X/e/3/e3514f60a0a35b0f5535992821398f8f86c60a53.jpeg)  
 ![2sh3](https://root-forum.cern.ch/uploads/default/original/3X/c/0/c0c2c39d67cc31d27856f88587c65b9b2f97282b.jpeg)  
 ![2sh4](https://root-forum.cern.ch/uploads/default/original/3X/2/c/2ce8a8b520649662ebbd66b393538bf523e594ae.jpeg)

\_

Noticing the PgSQL red error line, I tried to use the following commands (plus _-Dpgsql=OFF_):

```auto
cmake -G"Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -Dpgsql=OFF -DCMAKE_INSTALL_PREFIX="../root_install" "../root_source"
cmake --build . --config Release --target install

```

Still errors:

[CMakeCache.txt](https://root-forum.cern.ch/uploads/short-url/qCLn1F8sM5chhWLbKmlWRmMi9mV.txt) (120.3 KB)

 ![2sh5](https://root-forum.cern.ch/uploads/default/original/3X/c/9/c9949ee8c42f8a381d516af1a3b3372207c44636.jpeg)  
(It’s a screenshot of processing command window. I forget to make more screenshots for the final state of output).  
Command _cout \<\< 5_ caused a crash.

\_

After that I deleted my Visual Studio Community and uploaded trial Visual Studio Professional v16.4.6 (MSVC v14.24.28319.0). Executing pre-compiled ROOT v6.24.02 with Visual Studio v16.4.6 caused the same error (_cout \<\< 5_ crashes the command window).

So I built from source (Visual Studio v16.4.6). Results:

[CMakeCache.txt](https://root-forum.cern.ch/uploads/short-url/37bJZaYVMf5svt4MoYhADXUrEdC.txt) (120.4 KB)  
 ![изображение](https://root-forum.cern.ch/uploads/default/original/3X/e/1/e15801ede000e102dcd9641af71fd6eea49b1182.png)

 ![2sh6](https://root-forum.cern.ch/uploads/default/original/3X/5/a/5a869742f1c1bd30a143ee0c2017ca820a8d3096.jpeg)

\_

I asked a person with Windows 10, Visual Studio v16.10.2, MSVC v19.29.30038 to try pre-compiled ROOT v6.24.02. It worked well (typing _cout \<\< 5_ didn’t cause crash).

Any advices?

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 5, 2021, 1:46pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/5 "2021-07-05T13:46:48Z")

</div>

I’ll build ROOT with the latest version of Visual Studio and send you the link to the zip file asap

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 6, 2021, 6:19pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/6 "2021-07-06T18:19:37Z")

</div>

@bloop can you try with this version? [https://bellenot.web.cern.ch/public/root\_v6.24.02.win32.vc16.zip](https://bellenot.web.cern.ch/public/root_v6.24.02.win32.vc16.zip)  
And BTW, can you make sure you have the `Windows 10 SDK (10.0.19041.0)` installed on your system if you have Visual Studio v16.10

---

<div class="post-metadata">

**Author:** ![bloop](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bloop](https://root-forum.cern.ch/u/bloop)\
**Post date:** [July 7, 2021, 12:22pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/7 "2021-07-07T12:22:33Z")

</div>

Still the same error on Windows 7.

> And BTW, can you make sure you have the `Windows 10 SDK (10.0.19041.0)` installed on your system if you have Visual Studio v16.10

Yup.

 ![shtoroot](https://root-forum.cern.ch/uploads/default/original/3X/7/a/7a5f84694778cdde0e846679eac5422989b4f335.jpeg)

I have SP 1 which (as Microsoft tells us) is mandatory for using Windows 10 SDK on Windows 7.

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 7, 2021, 12:28pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/8 "2021-07-07T12:28:53Z")

</div>

So there is something on your system causing the issue. I’m sorry, but since Windows 7 is not supported by Microsoft anymore, we don’t have any Windows 7 machine to debug this…

---

<div class="post-metadata">

**Author:** ![bloop](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/ecccb3/32.png) [@bloop](https://root-forum.cern.ch/u/bloop)\
**Post date:** [July 7, 2021, 12:34pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/9 "2021-07-07T12:34:27Z")

</div>

Aww, sad… Probably I’ll use Windows 10 then.

Anyway, @bellenot, thank you for caring about my situation. I appreciate your concern very much!

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [July 7, 2021, 12:35pm UTC](https://root-forum.cern.ch/t/i-o-streams-problem-windows-7/45657/10 "2021-07-07T12:35:44Z")

</div>

You’re very welcome! 🙂
