# Critical error detected c0000374 with minimal example

**URL:** <https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804>\
**Category:** Newbie\
**Created:** [April 19, 2026, 6:24pm UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804 "2026-04-19T18:24:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mael15](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/ecc23a/32.png) [@mael15](https://root-forum.cern.ch/u/mael15)\
**Post date:** [April 19, 2026, 6:24pm UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/1 "2026-04-19T18:24:13Z")

</div>

* * *

_ROOT Version:_ 6.38.04  
_Platform:_ Windows  
_Compiler:_ Visual Studio 2026 (18.3.3)

* * *

I cannot get the simplest thing to run. I want to use ROOT in my c++ app and without even writing any special code, just including “TGraphErrors.h” compiels but results in error c0000374 without specifying any of my code. The call stack is:

> ntdll.dll!00007ffef1bf7555() Unbekannt  
> ntdll.dll!00007ffef1b7d929() Unbekannt  
> ntdll.dll!00007ffef1b067b2() Unbekannt  
> ntdll.dll!00007ffef1bfd91a() Unbekannt  
> ntdll.dll!00007ffef1afed9b() Unbekannt  
> ntdll.dll!00007ffef1b30cb5() Unbekannt  
> ntdll.dll!00007ffef1afd141() Unbekannt  
> ntdll.dll!00007ffef1afcd14() Unbekannt  
> ntdll.dll!00007ffef1afe2c9() Unbekannt  
> ntdll.dll!00007ffef1afce54() Unbekannt  
> ntdll.dll!00007ffef1afcd14() Unbekannt  
> ntdll.dll!00007ffef1af7da9() Unbekannt  
> KernelBase.dll!00007ffeee600877() Unbekannt  
> libCore.dll!00007ffdbd95ebc6() Unbekannt  
> libCore.dll!00007ffdbd85ab98() Unbekannt  
> libCore.dll!00007ffdbd853ab1() Unbekannt  
> libCore.dll!00007ffdbd84f40b() Unbekannt  
> libCore.dll!00007ffdbd7f15aa() Unbekannt  
> ucrtbase.dll!00007ffeee9fe686() Unbekannt  
> libCore.dll!00007ffdbdaadb5e() Unbekannt  
> libCore.dll!00007ffdbdaadccf() Unbekannt  
> ntdll.dll!00007ffef1c3f7ea() Unbekannt  
> ntdll.dll!00007ffef1aebc23() Unbekannt  
> ntdll.dll!00007ffef1ae979c() Unbekannt  
> ntdll.dll!00007ffef1b775aa() Unbekannt  
> ntdll.dll!00007ffef1b775d6() Unbekannt  
> ntdll.dll!00007ffef1b775d6() Unbekannt  
> ntdll.dll!00007ffef1b775d6() Unbekannt  
> ntdll.dll!00007ffef1b9d49d() Unbekannt  
> ntdll.dll!00007ffef1b9b630() Unbekannt  
> ntdll.dll!00007ffef1b9b41a() Unbekannt  
> ntdll.dll!00007ffef1bcb07e() Unbekannt

the code is:

```auto
#pragma once

#include <wx/frame.h>
#include <wx/app.h>
#include "TGraphErrors.h"

class MyFrame1 : public wxFrame 
{
public:
	MyFrame1( wxWindow* parent = NULL, 
		wxWindowID id = wxID_ANY, 
		const wxString& title = wxEmptyString, 
		const wxPoint& pos = wxDefaultPosition, 
		const wxSize& size = wxSize( 500,300 ), 
		long style = wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL) :
		wxFrame(parent, id, title, pos, size, style)
	{
		SetSizer(new wxBoxSizer(wxVERTICAL));

		this->SetSizeHints(wxDefaultSize, wxDefaultSize);
		this->Centre(wxBOTH);
	}
	~MyFrame1(){}
	void onButtonClicked(wxCommandEvent &evt) {

	}
};

class MyApp : public wxApp {
	virtual bool OnInit() {
		MyFrame1* mainFrame = new MyFrame1();
		mainFrame->Show();
		SetTopWindow(mainFrame);

		return TRUE;
	}
};

wxIMPLEMENT_APP(MyApp);

```

I link to libHist.lib and libCore.lib, both dlls are copied into the exe folder, ROOTSYS and Path are set.  
What could be wrong?  
Thank you!

---

<div class="post-metadata">

**Author:** ![mael15](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/ecc23a/32.png) [@mael15](https://root-forum.cern.ch/u/mael15)\
**Post date:** [April 19, 2026, 7:52pm UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/2 "2026-04-19T19:52:27Z")

</div>

maybe this note is the problem: “You must download the binary built with the exact same version of Visual Studio (and Python) than the one installed on your system.“  
since there is not visual studio 2026 binary?

---

<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:** [April 20, 2026, 7:50am UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/3 "2026-04-20T07:50:48Z")

</div>

Welcome to the ROOT Forum!  
Can you tell us how you build your project?

---

<div class="post-metadata">

**Author:** ![mael15](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/ecc23a/32.png) [@mael15](https://root-forum.cern.ch/u/mael15)\
**Post date:** [April 20, 2026, 8:39am UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/4 "2026-04-20T08:39:24Z")

</div>

i followed the instructions and substituted the cmake command with

```auto
cmake -G"Visual Studio 18 2026" -A x64 -Thost=x64 -DCMAKE_INSTALL_PREFIX=<installdir> <sourcedir>

```

---

<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:** [April 20, 2026, 8:42am UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/5 "2026-04-20T08:42:14Z")

</div>

Can I see your `CMakeLists.txt`? And I see you are also using `wxWindow`. Can you try with a very simple example, without `wxWindow`, to start with?

---

<div class="post-metadata">

**Author:** ![mael15](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/ecc23a/32.png) [@mael15](https://root-forum.cern.ch/u/mael15)\
**Post date:** [April 20, 2026, 11:46am UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/6 "2026-04-20T11:46:03Z")

</div>

I also tried the precompiled binaries of the latest stable release 6.26.10 with the same result.

```auto
#pragma once
#include "TGraphErrors.h"
#include <iostream>

int main() {
	std::cout << "Hello World";
}

```

EDIT: The error disappears when I remove all .dll files from the exe folder. But the build output shows “The C++ standard in this build does not match ROOT configuration (201703L); this might cause unexpected issues. And please make sure you are using the -Zc:\_\_cplusplus compilation flag“

CMakeLists.txt:

> cmake\_minimum\_required(VERSION 4.3.1)  
> set(CMAKE\_MODULE\_PATH “C:/root\_v6.38.04/src/cmake/modules”)  
> set(\_CMAKE\_CHECK\_ENABLED\_LANGUAGES “C;CXX;RC”)  
> set(CMAKE\_C\_COMPILER “C:/Program Files/Microsoft Visual Studio/18/Enterprise/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/cl.exe”)  
> set(CMAKE\_C\_COMPILER\_ID “MSVC”)  
> set(CMAKE\_C\_COMPILER\_LOADED 1)  
> set(CMAKE\_C\_COMPILER\_VERSION “19.50.35725.0”)  
> set(CMAKE\_CXX\_COMPILER “C:/Program Files/Microsoft Visual Studio/18/Enterprise/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/cl.exe”)  
> set(CMAKE\_CXX\_COMPILER\_ID “MSVC”)  
> set(CMAKE\_CXX\_COMPILER\_LOADED 1)  
> set(CMAKE\_CXX\_COMPILER\_VERSION “19.50.35725.0”)  
> set(CMAKE\_RC\_COMPILER “C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x86/rc.exe”)  
> set(CMAKE\_RC\_COMPILER\_ID “”)  
> set(CMAKE\_RC\_COMPILER\_LOADED 1)  
> set(CMAKE\_RC\_COMPILER\_VERSION “”)
> 
> project(CheckCUDA LANGUAGES CUDA)  
> file(WRITE “${CMAKE\_CURRENT\_BINARY\_DIR}/result.cmake" "set(CMAKE\_CUDA\_COMPILER "${CMAKE\_CUDA\_COMPILER}”)  
> ")

---

<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:** [April 20, 2026, 1:05pm UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/7 "2026-04-20T13:05:14Z")

</div>

OK, your `CMakeLists.txt` looks weird… It doesn’t show what you are trying to build (i.e. there is no `add_executable` nor `add_library`)  
Here is a simple example:

```auto
cmake_minimum_required(VERSION 3.12)

set(PROJECT_NAME test)
project(${PROJECT_NAME})

find_package(ROOT REQUIRED)
set(CMAKE_CXX_FLAGS "${ROOT_CXX_FLAGS}")

add_executable(test main.cpp)
target_include_directories(test PRIVATE ${ROOT_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(test PRIVATE ${ROOT_LIBRARIES})

```

Here, the important line is `set(CMAKE_CXX_FLAGS "${ROOT_CXX_FLAGS}")`, so you produce binary compatible code.  
Otherwise, you have to manually specify the proper compiler flags. I.e.

```auto
set(CMAKE_CXX_STANDARD 17)
add_compile_options(/Zc:__cplusplus)

```

And no need to move files (DLLs) around, if you properly call `root\bin\thisroot.bat`, everything is set up for you.

---

<div class="post-metadata">

**Author:** ![mael15](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/ecc23a/32.png) [@mael15](https://root-forum.cern.ch/u/mael15)\
**Post date:** [April 20, 2026, 1:44pm UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/8 "2026-04-20T13:44:31Z")

</div>

Thank you!

I continued to try different things and started using the precompiled binaries. I saw that everything works just fine when I install root with the installer and let it add to the Path variable.

BUT: I will have to distribute my app to other systems and would like to not have to install root everywhere. So I was hoping I could just copy the necessary dlls into the exe folder. I used the dependency walker to see which dlls are linked on my developer machine und copied those into the exe folder on a different test system without root installed. This did not work and resulted in the afformentioned

> Critical error detected c0000374  
> (1a24.770): Break instruction exception - code 80000003 (first chance)  
> ntdll!RtlIsZeroMemory+0xa2:

Is there no way to NOT having to install root on every system my app should run on?

---

<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:** [April 20, 2026, 1:50pm UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/9 "2026-04-20T13:50:07Z")

</div>

Well, not really. ROOT needs not only its DLLs, but also its plugins, icons (pixmap), fonts, config files, and so on… All relative to `%ROOTSYS%`. And it also needs the MSVC runtime environment, to be able to find the C++ headers (for the JIT interpreter). Now, depending on what subset of libraries you need, one might find a solution, but it would require quite some time and effort to investigate what minimal set would be needed.

---

<div class="post-metadata">

**Author:** ![mael15](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/ecc23a/32.png) [@mael15](https://root-forum.cern.ch/u/mael15)\
**Post date:** [April 20, 2026, 2:47pm UTC](https://root-forum.cern.ch/t/critical-error-detected-c0000374-with-minimal-example/64804/10 "2026-04-20T14:47:45Z")

</div>

Aaaah, alright, then my problem is solved, thank you!

I guess I underestimated ROOT´s complexity. 🙂
