Cin cout crashed my self-compiled ROOT V6.16

ROOT Version: 6.16/00
Platform: Win7 64-bit
Compiler: MSVS2019

As showed in the posthere, I compiled the ROOT v6.16.
However, while using the ‘cin’ ‘cout’ in my program or just use them in the cint[], my ROOT will be crashed.

Please help.
Thank you very much!


As I remember, this problem occurs with the pre-compiled versions that download form ROOT Download.

Hi, this seems to be fixed in more recent version of ROOT. See for example with the master branch in git:

C:\Users\bellenot\build\release>root -l
root [0] cout << "test" << endl;
root [1]

Great! Thanks a lot.

Note that if you take the pre-built nightly binaries for Visual Studio 2019, it works as well. For example this one: from the nightly builds

Thank you very much!

Best wishes!

1 Like

Hi, this problem seems not fixed with the master branch of git (

Here is a little Debug information.(PS: This problem occurs also in the release version.)


“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\root.exe”。已加载符号。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\ntdll.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\kernel32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\KernelBase.dll”。
“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\libRint.dll”。已加载符号。
“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\libCore.dll”。已加载符号。
“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\liblzma.dll”。模块已生成,不包含符号。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\msvcrt.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\shell32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\shlwapi.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\gdi32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\user32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\advapi32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\sechost.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\rpcrt4.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\sspicli.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\cryptbase.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\lpk.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\usp10.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\wsock32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\ws2_32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\nsi.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\IPHLPAPI.DLL”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\winnsi.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\ole32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\msvcp140.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\vcruntime140.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-runtime-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\ucrtbase.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-core-timezone-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-core-file-l2-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-core-localization-l1-2-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-core-synch-l1-2-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-core-processthreads-l1-1-1.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-core-file-l1-2-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-heap-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-string-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-stdio-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-convert-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-locale-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-math-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-filesystem-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-time-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-environment-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\api-ms-win-crt-utility-l1-1-0.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\WindowsCodecs.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\msimg32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\imm32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\msctf.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\dhcpcsvc.dll”。
“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\libRIO.dll”。已加载符号。
“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\libThread.dll”。已加载符号。
“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\libCling.dll”。已加载符号。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\version.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\oleaut32.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\uxtheme.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\clbcatq.dll”。
“root.exe”(Win32): 已加载“C:\Program Files (x86)\Common Files\microsoft shared\ink\tiptsf.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\dwmapi.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\cryptsp.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\rsaenh.dll”。
“root.exe”(Win32): 已加载“C:\Windows\SysWOW64\RpcRtRemote.dll”。
“root.exe”(Win32): 已加载“G:\root-master-v616\build\bin\libMathCore.dll”。已加载符号。
线程 0x568 已退出,返回值为 0 (0x0)。
0x7760E4E3 (ntdll.dll) (root.exe 中)处有未经处理的异常: 0xC0000005: 写入位置 0x000000F1 时发生访问冲突。

Thank you!
Best Wishes,

Sorry, I can’t reproduce the problem:

C:\Users\bellenot\build\release>root -l
root [0] cout << "test";
root [1] cout << "test"
test(std::basic_ostream<char, std::char_traits<char> > &) @0x76521ba8
root [2] cout << "test";
root [3] cout << endl;

root [4] .q


Did you build ROOT yourself? That could be the issue. Could you try to build it like the following (select you own directories):

C:\Users\bellenot\temp\git>git clone master
Cloning into 'master'...
remote: Enumerating objects: 676980, done.
remote: Total 676980 (delta 0), reused 0 (delta 0), pack-reused 676980
Receiving objects: 100% (676980/676980), 715.41 MiB | 10.89 MiB/s, done.
Resolving deltas: 100% (488785/488785), done.
Checking out files: 100% (18544/18544), done.

C:\Users\bellenot\temp\git>cd ..\build\master

C:\Users\bellenot\temp\build\master>cmake -A Win32 -Thost=x64 ..\..\git\master
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.14393.
-- The C compiler identification is MSVC 19.20.27508.1
-- The CXX compiler identification is MSVC 19.20.27508.1

skipping output...

-- Performing Test has_found_attribute_noinline - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/bellenot/temp/build/master

C:\Users\bellenot\temp\build\master>cmake --build . --config Release
Microsoft (R) Build Engine version 16.0.462+g62fb89029d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  CMake does not need to re-run because C:/Users/bellenot/temp/build/master/CMakeFiles/generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/bellenot/temp/build/master/builtins/zlib/CMakeFiles/generate.stamp is

skipping output...


C:\Users\bellenot\temp\build\master>cmake --build . --config Debug

Thank you very much for your reply.
I will try it.

Best Wishes!

This problem is due to the Windows 7. At last I moved to Windows 10. This issue is fixed. It seems that the Windows 7 is out-of-date.
I re-build git/master of ROOT v6.17. The re-build method is the same as I had posted here.
However a new problem troubled me!
When run a program, ROOT gives the following ERROR message:

root [0] .x DrawPulser.cpp
Error in TCling::RegisterModule: cannot find dictionary module libMatrix_rdict.pcm
Error in TCling::RegisterModule: cannot find dictionary module libHist_rdict.pcm
Error in TCling::RegisterModule: cannot find dictionary module libGraf_rdict.pcm
Error in TCling::RegisterModule: cannot find dictionary module libGpad_rdict.pcm
Error in TCling::RegisterModule: cannot find dictionary module libGui_rdict.pcm

I have checked that all of these *.pcm files is installed in $(ROOTSYS)lib .

Would you please kindly help me?
Thank you very much!

How did you build ROOT? Did you install it? Did you call root\bin\thisroot.bat? Can you execute any of the ROOT tutorials?

1.How did you build ROOT?
I build the ROOTv617 with Visual Studio 2019 in the “Windows” mode as shown in this picture:

I have tried the command lines (with my own directories): cmake -A Win32 -Thost=x64 …\master; cmake --build . --config Debug. However, the libWin32gdk is not produced. I am sure that this is because the file .\graf2d\win32gdk\gdk\src\glib\gunichartables.h has to be changed and saved in the ** Unicode (UTF-8 with signature ) - Codepage 65001** format. With this modification, in “Windows” mode with VS2019, I re-build ROOTv617 successfully.
PS:Is there some difference of the ‘command line’ mode with cmake and the ‘Whindow’ mode with VS2019?

2.Did you install it?
Yes, I do run the command line cmake -P cmake_install.cmake .

**3.Did you call root\bin\thisroot.bat **
Yes, On Windows 10, with PowerShell, I run thisroot.bat.

4.Can you execute any of the ROOT tutorials?
Yes, I can execute most of the .demo macros, except the geom/geometry.C.
While execute the .demo macros ROOT gives the same ERROR message that: Error in TCling::RegisterModule: cannot find dictionary module *.pcm

Thank you very much!
Best wishes!

I don’t understand why you over-complicate things… Could you simply try the following:

  • Open a x86 Native Tools Command Prompt for VS 2019
  • download the source code of ROOT (or git clone the repository) don’t edit/modify anything!!
  • create a build directory and cd into it
  • cmake -A Win32 -Thost=x64 …\master (or wherever the unmodified source is)
  • cmake --build . --config Debug

When the build is over, call bin\thisroot.bat, and then try to execute your DrawPulser.cpp and let me know

Thank you very much for your patient.
I am doing a new building. It needs about 3 hours on my laptop.
I will let you know the result.

Best wishes!

The file gunichartables.h gives a lot of error.
I uploaded the error messages here. This is why I modified this file as I discribed before.
build.txt (16.7 KB)

Please help!
Thank you!
Best Wishes!

First, don’t generate nmake makefiles, use -G"Visual Studio 16 2019"
Then, how did you take the source code? from a tar file or from git? I’ve never seen this error before…

I clone the sourece code form git\master, not the tar file.
My Windows is in Chinese and the VS2019 is also in Chinese. Should this be the reasone of the error?
My Cmake version is 3.14.3.

Thank you!

I don’t think so, but who knows… Anyway, for sure you must not generate nmake makefiles!

Thank you.
To avoid the produce of nmake file the command line should be write as this:
cmake -A Win32 -Thost=x64 -G"Visual Studio 16 2019" …\master
cmake --build . --config Debug
Am I right?
I am not good at cmake. Please help.

Thank you!

And BTW, not sure if this could change anything, but the core.autocrlf value of git config should be set as input:

C:\Users\bellenot\github\master>git config core.autocrlf