# Using ACLiC to compile a macaro

**URL:** <https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349>\
**Category:** Newbie\
**Created:** [September 9, 2020, 3:00am UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349 "2020-09-09T03:00:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [September 9, 2020, 3:00am UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349/1 "2020-09-09T03:00:14Z")

</div>

Hello

I am using ROOT 6.22/02 on Windows 10 ([https://root.cern/download/root\_v6.22.02.win32.vc16.exe](https://root.cern/download/root_v6.22.02.win32.vc16.exe)) with Visual studio Community 2019 and trying to run script hsimple.C with ACLiC and I get errors below.  
I tried to run my own script, which works fine in ROOT 5.34.38, received errors and tried the tutorial hsimple.C, the errors are similar.  
The output is below. Could you explain to me what I need to do differently.

First in cmd window I have

```auto
C:\root_v6.22.02\tutorials> "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"

```

then

```auto
C:\root_v6.22.02\tutorials>root -l hsimple.C+

Welcome to the ROOT tutorials

Type ".x demos.C" to get a toolbar from which to execute the demos

Type ".x demoshelp.C" to see the help window

==> Many tutorials use the file hsimple.root produced by hsimple.C
==> It is recommended to execute hsimple.C before any other script

root [0]
Processing hsimple.C+...
Info in <TWinNTSystem::ACLiC>: creating shared library C:/root_v6.22.02/tutorials/hsimple_C.dll
In file included from input_line_3:2:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\string:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xstring:14:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xmemory:16:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility:15:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:137:9: error: expected member name or ';' after declaration specifiers
        !_Is_implicitly_default_constructible<_Uty1>::value || !_Is_implicitly_default_constructible<_Uty2>::value)
        ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:137:9: error: expected ')'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:136:23: note: to match this '('
    constexpr explicit(
                      ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:218:24: error: expected member name or ';' after declaration specifiers
    constexpr explicit(!is_convertible_v<const _Other1&, _Ty1> || !is_convertible_v<const _Other2&, _Ty2>)
    ~~~~~~~~~~~~~~~~~~ ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:218:24: error: expected ')'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:218:23: note: to match this '('
    constexpr explicit(!is_convertible_v<const _Other1&, _Ty1> || !is_convertible_v<const _Other2&, _Ty2>)
                      ^
In file included from input_line_3:2:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\string:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xstring:14:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xmemory:16:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility:63:31: error: '_To' does not refer to a value
    return __builtin_bit_cast(_To, _Val);
                              ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility:51:17: note: declared here
template <class _To, class _From,
                ^
In file included from input_line_6:1:
In file included from C:/root_v6.22.02/include\Rtypes.h:23:
C:/root_v6.22.02/include/RtypesCore.h:89:14: error: redefinition of 'kTRUE'
const Bool_t kTRUE = true;
             ^
note: 'C:/root_v6.22.02/include/RtypesCore.h' included multiple times, additional include site here
fatal error: cannot open file 'input_line_3': no such file or directory
C:/root_v6.22.02/include\Rtypes.h:23:10: note: 'C:/root_v6.22.02/include/RtypesCore.h' included multiple times, additional include site here
#include "RtypesCore.h"
         ^
C:/root_v6.22.02/include/RtypesCore.h:89:14: note: unguarded header; consider using #ifdef guards or #pragma once
const Bool_t kTRUE = true;
             ^
Error in <ACLiC>: Executing 'C:\root_v6.22.02\bin\rootcling -v0 "--lib-list-prefix=C:\root_v6.22.02\tutorials\hsimple_C_ACLiC_map" -f "C:\root_v6.22.02\tutorials\hsimple_C_ACLiC_dict.cxx" -rml hsimple_C -rmf "C:\root_v6.22.02\tutorials\hsimple_C.rootmap" -DR __ACLIC_ROOTMAP -I%ROOTSYS%\include -D__ ACLIC__"C:/root_v6.22.02/tutorials/hsimple.C" "C:\root_v6.22.02\tutorials\hsimple_C_ACLiC_linkdef.h"' failed!

    ------------------------------------------------------------------
  | Welcome to ROOT 6.22/02 https://root.cern |
  | (c) 1995-2020, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win32 on Aug 17 2020, 12:46:52 |
  | From tags/v6-22-02@v6-22-02 |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
   ------------------------------------------------------------------

```

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ 6.22/02  
_Platform:_ Windows 10  
_Compiler:_ Visual Studio 2019

* * *

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [September 9, 2020, 1:44pm UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349/2 "2020-09-09T13:44:39Z")

</div>

Indeed, I remember that error. It shows up with recent versions of MSVC (Visual Studio 2019 v16.7.0 to be precise). @bellenot worked around it by defining ` __CUDACC__ `.

If you built your own ROOT you can add the following lines:

```diff
diff --git a/interpreter/cling/lib/Interpreter/CIFactory.cpp b/interpreter/cling/lib/Interpreter/CIFactory.cpp
index c01e6221e6..738666ac61 100644
--- a/interpreter/cling/lib/Interpreter/CIFactory.cpp
+++ b/interpreter/cling/lib/Interpreter/CIFactory.cpp
@@ -788,6 +788,12 @@ static void stringifyPreprocSetting(PreprocessorOptions& PPOpts,
     PPOpts.addMacroDef(" __CLING__ GNUC_MINOR__=" ClingStringify(__GNUC_MINOR__));
 #elif defined(_MSC_VER)
     PPOpts.addMacroDef(" __CLING__ MSVC__=" ClingStringify(_MSC_VER));
+#if (_MSC_VER >= 1926)
+ // FIXME: Silly workaround for cling not being able to parse the STL
+ // headers anymore after the update of Visual Studio v16.7.0
+ // To be checked/removed after the upgrade of LLVM & Clang
+ PPOpts.addMacroDef(" __CUDACC__");
+#endif
 #endif
 
 // https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html

```

Or you grab a nightly binary which should have that fixed: [https://root.cern/download/nightly/?C=N;O=D](https://root.cern/download/nightly/?C=N;O=D)

Cheers, Axel.

---

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [September 10, 2020, 2:44am UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349/3 "2020-09-10T02:44:01Z")

</div>

Thank you Axel,

I tried the nightly build and I have the same errors.

```auto
Processing hsimple.C+...
Info in <TWinNTSystem::ACLiC>: creating shared library C:/root_v6.23.01/tutorials/hsimple_C.dll
In file included from input_line_3:2:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\string:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xstring:14:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xmemory:16:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility:15:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:137:9: error: expected member name or ';' after declaration specifiers
        !_Is_implicitly_default_constructible<_Uty1>::value || !_Is_implicitly_default_constructible<_Uty2>::value)
        ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:137:9: error: expected ')'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:136:23: note: to match this '('
    constexpr explicit(
                      ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:218:24: error: expected member name or ';' after declaration specifiers
    constexpr explicit(!is_convertible_v<const _Other1&, _Ty1> || !is_convertible_v<const _Other2&, _Ty2>)
    ~~~~~~~~~~~~~~~~~~ ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:218:24: error: expected ')'
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\utility:218:23: note: to match this '('
    constexpr explicit(!is_convertible_v<const _Other1&, _Ty1> || !is_convertible_v<const _Other2&, _Ty2>)
                      ^
In file included from input_line_3:2:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\string:11:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xstring:14:
In file included from C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xmemory:16:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility:63:31: error: '_To' does not refer to a value
    return __builtin_bit_cast(_To, _Val);
                              ^
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\\include\xutility:51:17: note: declared here
template <class _To, class _From,
                ^
In file included from input_line_6:1:
In file included from C:/root_v6.23.01/include\Rtypes.h:23:
C:/root_v6.23.01/include/RtypesCore.h:91:17: error: redefinition of 'kTRUE'
const Bool_t kTRUE = true;
                ^
note: 'C:/root_v6.23.01/include/RtypesCore.h' included multiple times, additional include site here
fatal error: cannot open file 'input_line_3': no such file or directory
C:/root_v6.23.01/include\Rtypes.h:23:10: note: 'C:/root_v6.23.01/include/RtypesCore.h' included multiple times, additional include site here
#include "RtypesCore.h"
         ^
C:/root_v6.23.01/include/RtypesCore.h:91:17: note: unguarded header; consider using #ifdef guards or #pragma once
const Bool_t kTRUE = true;
                ^
Error in <ACLiC>: Executing 'C:\root_v6.23.01\bin\rootcling -v0 "--lib-list-prefix=C:\root_v6.23.01\tutorials\hsimple_C_ACLiC_map" -f "C:\root_v6.23.01\tutorials\hsimple_C_ACLiC_dict.cxx" -rml hsimple_C -rmf "C:\root_v6.23.01\tutorials\hsimple_C.rootmap" -DR __ACLIC_ROOTMAP -I%ROOTSYS%\include -D__ ACLIC__"C:/root_v6.23.01/tutorials/hsimple.C" "C:\root_v6.23.01\tutorials\hsimple_C_ACLiC_linkdef.h"' failed!

```

Anton

---

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [September 10, 2020, 3:19am UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349/4 "2020-09-10T03:19:23Z")

</div>

I tried to build root also,  
I did in termianal

```auto
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat"

D:\>cd root-6.22.02-build

cmake -Dall=OFF -Dmathmore=OFF -Dbuiltin_zlib=ON -Dgfal=OFF -Dbuiltin_freetype=ON -Dbuiltin_ftgl=ON -Droofit=ON -Dfftw3=ON -DFFTW_INCLUDE_DIR=D:\fftw -DFFTW_LIBRARY=D:\fftw\libfftw3-3.lib D:\root-6.22.02-source

```

The output is in cmake-output-1.txt.  
Then

```auto
cmake --build . --config Release > cmake-build-1.txt

```

The output is in cmake-build-1.txt

And no success

Anton

[cmake-output-1.txt](https://root-forum.cern.ch/uploads/short-url/aIjhS8JDyIgjcOuKeJcCY03NBcJ.txt) (9.2 KB) [cmake-build-1.txt](https://root-forum.cern.ch/uploads/short-url/x3d1UxK4ICtCNybjY6vKO8Hlqs7.txt) (876.7 KB)

---

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [September 16, 2020, 9:53am UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349/5 "2020-09-16T09:53:29Z")

</div>

Any help on how to compile root on Windows 10?

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [September 24, 2020, 3:08pm UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349/6 "2020-09-24T15:08:21Z")

</div>

You need two extra switches: `-A Win32 -Thost=x64`, see [Run ROOT 6.19.02 on Windows 10](https://root-forum.cern.ch/t/run-root-6-19-02-on-windows-10/38529/14)

---

<div class="post-metadata">

**Author:** ![bogomyag](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/b/e0b2c6/32.png) [@bogomyag](https://root-forum.cern.ch/u/bogomyag)\
**Post date:** [September 25, 2020, 4:21am UTC](https://root-forum.cern.ch/t/using-aclic-to-compile-a-macaro/41349/7 "2020-09-25T04:21:24Z")

</div>

Thanks Axel,  
I tried that and still received errors.

```auto
cmake -G "Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_CXX_STANDARD=14 -Droofit=ON -Dfftw3=ON -DFFTW_INCLUDE_DIR=D:\fftw -DFFTW_LIBRARY=D:\fftw\libfftw3-3.lib D:\root-6.22.02-source > ..\cmake-output-2.txt

```

I think configuration and generating went without errors [cmake-output-2.txt](https://root-forum.cern.ch/uploads/short-url/d2o3P2MrZpZjZoEXyfFq4bw9TfO.txt) (10.1 KB)

```auto
cmake --build . --config Release -- /maxcpucount > ..\cmake-build-2.txt

```

and here were errors [cmake-build-2.txt](https://root-forum.cern.ch/uploads/short-url/8L7iS4AVkmplpJl5ZMoyeYZwu9z.txt) (1.4 MB)

Here is my configuration of VS

 ![Screenshot-VisualStudio](https://root-forum.cern.ch/uploads/default/original/3X/2/a/2aac22fad077fba9913d7f159a0727dffcaf6321.png)

I followed [Run ROOT 6.19.02 on Windows 10](https://root-forum.cern.ch/t/run-root-6-19-02-on-windows-10/38529/14)  
and I read [Building and Executing ROOT6 on Windows with VS2019](https://root-forum.cern.ch/t/building-and-executing-root6-on-windows-with-vs2019/39864)  
but I do not see encoding related errors.
