I/o streams problem (windows 7)


Please read tips for efficient and successful posting and posting code

ROOT Version: v6.24.02
Platform: Windows 7
Compiler: MSVC 19.23.28107.0


Good day, everybody.

My problem is similar to rajliv.

I have installed a pre-compiled binary distribution of ROOT for Windows. Then I type (using x86 Native Tools Command Prompt for VS 2019):

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

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

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.

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.

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:

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]

Thanks, I’ll try to build from source.

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

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 (121.3 KB)




_

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

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 (120.3 KB)


(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 (120.4 KB)
изображение

_

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?

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

@bloop can you try with this version? 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

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.

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

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…

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

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

1 Like

You’re very welcome! :slight_smile: