How to run rf104_classfactory.C example?

Hello!

I want to create my own PDF.
This macro root.cern.ch/root/htmldoc/tutor … ory.C.html must illustrate how to do this

But I can’t undestand how to run this macro.
They say:

//       To run this macro compiled with ACliC do
//
//         root>.x rf104_classfactory.C // run interpreted to generate code
//         root>.L MyPdfV3.cxx+         // Compile and load created classs
//         root>.x rf104_classfactory.C+ // run compiled code

I have written in rootlogon.C :

{
gROOT->ProcessLine(".x D:\\git_repositories\\Afterpulsing\\rf104_classfactory.C");
}

and got this error:

←[1mRooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby←[0m
                Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
                All rights reserved, please read http://roofit.sourceforge.net/license.txt

Info in <TWinNTSystem::ACLiC>: creating shared library C:\Users\Vladislav\MyPdfV3_cxx.dll
"cl.exe" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
Error: external preprocessing failed. (0)
!!!Removing C:\Users\Vladislav\MyPdfV3_cxx_ACLiC_dict.cxx C:\Users\Vladislav\MyPdfV3_cxx_ACLiC_dict.h !!!
Error: C:\root_v5.34.32\bin\rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity
Error: Function MyPdfV3() is not defined in current scope  D:\git_repositories\Afterpulsing\rf104_classfactory.C(82)
*** Interpreter error recovered ***
Error: Invalid type 'MyPdfV3' in declaration of 'pdf' D:\git_repositories\Afterpulsing\rf104_classfactory.C(89)
Error: Function MyPdfV3 pdf("pdf","pdf",y,a,b) is not defined in current scope  D:\git_repositories\Afterpulsing\rf104_c
lassfactory.C(89)
*** Interpreter error recovered ***
Error: Symbol y is not defined in current scope  D:\git_repositories\Afterpulsing\rf104_classfactory.C(85)
Error: Failed to evaluate y.frame(Title("Compiled class MyPdfV3"))
*** Interpreter error recovered ***

What is wrong?

Hi,

can you run Aclic at all? You can test this with this macro and command:

// mymacro.cxx
void mymacro(){}
root[0] .L mymacro.cxx++

It seems that the cl.exe command is not found. Did you install visual studio?

Danilo

Hello!

I have the same error:

Info in <TWinNTSystem::ACLiC>: creating shared library C:\root_v5.34.32\macros\mymacro_cxx.dll
"cl.exe" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
Error: external preprocessing failed. (0)
!!!Removing C:\root_v5.34.32\macros\mymacro_cxx_ACLiC_dict.cxx C:\root_v5.34.32\macros\mymacro_cxx_ACLiC_dict.h !!!
Error: C:\root_v5.34.32\bin\rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity

Yes, I have visual studio.

Microsoft Visual Studio Community 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51209

Is there any conflict between Visual Studio and Root?

Hi,

thanks for the test: this looks consistent with the previous post. Did you install ROOT from binaries or did you build it yourself?
Is the cl.exe executable avalable in your path?

Cheers,
Danilo

Hello!

I have installed ROOT from binaries.

No, I can’t execute cl.exe.

Hi,

aclic tries to invoke cl.exe to compile the library. If we want it to work, you should have cl.exe in your path.

Danilo