So I can’t quite figure out how to compile my code on Windows 10. I installed root using the latest .exe installer for windows and installed it into directory D:\ROOT\root_v6.28.04
, since there was some problem for ROOT with adding itself to PATH (“path variable is too long”) I had to manually add the root_v6.28.04, bin and macro folders to PATH, then just ran a visual studio code inside macro folder and used root inside the built-in terminal of VS code.
I know my macro runs well using root’s C++ interpreter (it just draws some 2D gaussian distribution), however when I try to compile the code using root histogram_2D.cpp+
it returns this code which I don’t know how to interpret:
root [0]
Processing histogram_2D.cpp+...
Info in <TWinNTSystem::ACLiC>: creating shared library D:/ROOT/root_v6.28.04/macros/histogram_2D_cpp.dll
==========================================
=============== STACKTRACE ===============
==========================================
================ Thread 0 ================
libCore!TWinNTSystem::DispatchSignals()
ucrtbase!seh_filter_exe()
root!Init_thread_header()
VCRUNTIME140!_C_specific_handler()
ntdll!_chkstk()
ntdll!RtlRaiseException()
ntdll!KiUserExceptionDispatcher()
libCore!TWinNTSystem::GetLibraries()
libCore!TSystem::CompileMacro()
libCling!TCling::ProcessLine()
libCling!TCling::ProcessLineSynch()
libCore!TApplication::ExecuteFile()
libCore!TApplication::ProcessLine()
libRint!TRint::ProcessLineNr()
libRint!TRint::Run()
root!??
root!??
KERNEL32!BaseThreadInitThunk()
ntdll!RtlUserThreadStart()
================ Thread 1 ================
ntdll!NtWaitForWorkViaWorkerFactory()
ntdll!RtlInitializeResource()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlUserThreadStart()
================ Thread 2 ================
ntdll!NtWaitForWorkViaWorkerFactory()
ntdll!RtlInitializeResource()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlUserThreadStart()
================ Thread 3 ================
ntdll!NtWaitForWorkViaWorkerFactory()
ntdll!RtlInitializeResource()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlUserThreadStart()
================ Thread 4 ================
ntdll!NtDelayExecution()
KERNELBASE!SleepEx()
libCore!TWinNTSystem::TimerThread()
libCore!TWinNTSystem::ThreadStub()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlUserThreadStart()
================ Thread 5 ================
win32u!NtUserGetMessage()
USER32!GetMessageA()
libCore!TWinNTSystem::FreeDirectory()
KERNEL32!BaseThreadInitThunk()
ntdll!RtlUserThreadStart()
==========================================
============= END STACKTRACE =============
==========================================
Nothing is being shown/drawn unlike just running it normally, the library histogram_2D_cpp.dll
isn’t even being created too. It seems like I installed gcc/g++ in my system, but the problem persists. Do I need to rename my function from void histogram_2D()
to int main()
? (It didn’t help when I did). I have all the required ROOT classes included in my program, so that shouldn’t be a problem. Honeslty I’m not even sure what output of a compilation should I expect? An exe file or perhaps something else? There’s a bunch being created in my macro folder like .d
, .rootmap
, ACLiC_map.in
, etc.
I know visual studio code doesn’t come with a compiler by default, but is there a way to still compile my C++ code, while editing it in VS code? I really don’t want to use visual studio because it creates a bunch of extra files and folders I don’t need in my macros folder.
ROOT Version: 6.28.04
Platform: Windows 10
Compiler: Not Provided