Loading and invoking compiled code?


ROOT Version: 6.28
Platform: Windows 11
Compiler: Cling, gnu available


When a loade my program with ‘.L program.cpp+’ it seems to work find, but whenI try to execute it it doesn’t fined. it. ‘.L’ w/o ‘+’ works fins. But when I try to execute wiht ‘+’ applied ROOT complains. E.g.,

root [1] simu2XDStarLNu(100)
input_line_10:2:3: error: use of undeclared identifier 'simu2XDStarLNu'
 (simu2XDStarLNu(100))

I pretty sure this worked when I used root on Linux long ag…

Can you provide a small example reproducing this behaviour ?

Here is cut and paste:

root [0] .L simu2XDStarLNu.cpp++
Info in <TWinNTSystem::ACLiC>: creating shared library C:/Users/snyde/BFROOT/ROOT/simu2XDStarLNu_cpp.dll

==========================================
=============== STACKTRACE ===============
==========================================


================ Thread 0 ================
  libCore!TWinNTSystem::ShowMembers()
  ucrtbase!seh_filter_exe()
  root!??
  KERNEL32!BaseThreadInitThunk()
  ntdll!RtlInitializeExceptionChain()
  ntdll!RtlClearBits()

================ Thread 1 ================
  ntdll!ZwWaitForWorkViaWorkerFactory()
  KERNEL32!BaseThreadInitThunk()
  ntdll!RtlInitializeExceptionChain()
  ntdll!RtlClearBits()

================ Thread 2 ================
  ntdll!ZwWaitForWorkViaWorkerFactory()
  KERNEL32!BaseThreadInitThunk()
  ntdll!RtlInitializeExceptionChain()
  ntdll!RtlClearBits()

================ Thread 3 ================
  ntdll!ZwWaitForWorkViaWorkerFactory()
  KERNEL32!BaseThreadInitThunk()
  ntdll!RtlInitializeExceptionChain()
  ntdll!RtlClearBits()

================ Thread 4 ================
  ntdll!ZwDelayExecution()
  KERNELBASE!SleepEx()
  KERNELBASE!Sleep()
  libCore!TWinNTSystem::TimerThread()

================ Thread 5 ================
  win32u!NtUserGetMessage()
  libCore!TWinNTSystem::FreeDirectory()
  KERNEL32!BaseThreadInitThunk()
  ntdll!RtlInitializeExceptionChain()
  ntdll!RtlClearBits()

==========================================
============= END STACKTRACE =============
==========================================

root [0]
root [0]  simu2XDStarLNu(100)
input_line_10:2:3: error: use of undeclared identifier 'simu2XDStarLNu'
 (simu2XDStarLNu(100))

It seems the loading did not work properly. Can you provide a small example reproducing the problem ? as it is on windows may be @bellenot may have some ideas.

Well, as you can see, for some reason the build fails, so since the DLL is not created, ROOT cannot execute the function. Can you provide the information about your system, the version of ROOT and way you installed it, and how you started it, and from where (command prompt, command prompt for Visual Studio, …)?

I’m using 6.28 o Window-11. I installed using *.exe file from ROOT pages.

This one:

OK, thanks, and how you started it, and from where (command prompt, command prompt for Visual Studio, …)?

I start root from command prompt with

function doroot {C:\root_v6.28.06\bin\root.exe}

which is where the ‘.exe’ put it.

I was supprised it didn’t put in ‘Program Files’ though things are a little difficult to exectue from the ‘PowerShell’ as it is confused by the blank in directory name (have to put in in “”).

Can you make sure you have Visual Studio and its Desktop development with C++ workload properly installed, and then start ROOT from a x86 Native Command Prompt for VS 2022

I have Visual c++ installed. I’ve never used it. As a pre-GUI person, I find it confusing. I’m not sure how to do what you suggest. I start root from the command line in PowerShell.

What about trying to type x86 Native Command Prompt for VS 2022 in the search box of the Windows taskbar?

Three copies in downloads!


I likely executed one of them.

I don’t know what you’re trying to do… You already installed ROOT in C:\root_v6.28.06, so no need to try to install something else. Do the following:

  • Open a x86 Native Command Prompt for VS 2022 via the Windows 11 main menu (search for it if you don’t find it)
  • In that command prompt, type cd \Users\snyde\BFROOT\ROOT
  • Still in that command prompt, type C:\root_v6.28.06\bin\thistoot.bat
  • Now you can start ROOT by typing root

Thanks, I’ll check it out.

That worked. I found my way to a developer ‘PowerShell’ w/o getting too lost in the Goo. I guess in this context it is using Visual C++ to do the compliatiion.

Thanks much, Arthur (a.k.a., Traruh)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.