# Migrating from ROOT 5 to ROOT 6 in Windows 10

**URL:** <https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183>\
**Category:** ROOT\
**Created:** [January 7, 2019, 10:19am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183 "2019-01-07T10:19:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 7, 2019, 10:19am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/1 "2019-01-07T10:19:03Z")

</div>

Dear all,

This is my first root (and not newbie) post, so I hope its on the correct category. I migrated from root 5.32.36 to the production version root 6.14.06 in windows 10 unsung MSVS 2017 and rebuilding root from scratch. Now, reading through past posts on the forum I managed to find a setup of versions for visual studio and cmake that would allow to do the configuration and compilation of root without errors (in spite of around 300 warnings). Here are the details of the setup that worked:

Microsoft Visual Studio Community 2017 15.7.6  
CMake 3.7.2  
FFTW 3.3.5

and the cmake commands for configuration and compilation:

`cmake -G"Visual Studio 15 2017" -Dall=OFF -Dmathmore=OFF -Dbuiltin_zlib=ON -Dgfal=OFF -Dbuiltin_freetype=ON -Dbuiltin_ftgl=ON -Droofit=ON -Dfftw3=ON -DFFTW_INCLUDE_DIR=C:/root/fftw-3.3.5-dll32 -DFFTW_LIBRARY=C:/root/fftw-3.3.5-dll32/libfftw3-3.lib C:\root\Source\v6.14.06`

`cmake --build . --config Release -- /maxcpucount`

Please note than this is the only setup I managed to get working (previous MSVS 2017 would not compile and previous or later cmake version would not configure).

Anyway, trying to compile now same code that was running perfectly in root 5 I get the following error:

```auto
C:\WINDOWS\System32\KERNEL32.DLL : fatal error LNK1107: fichier non valide ou endommagé : impossible de lire à 0x2E0
Error in <ACLiC>: Compilation failed!

```

Went a bit rough the Microsoft knowledge base and this seems to be related to the linker trying to get the dll file instead of the lib file, or more specifically someone having specified the extension for the linker instead of just KERNEL32. That been said, I do not know where exactly I need to correct that, especially since I did not make my code as a visual studio project.  
Any input would be great!!!

Thanks a lot,

Vagelis

* * *

\_ROOT Version: 6.14.06  
\_Platform: Windows 10  
\_Compiler: VC++ 15

* * *

---

<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:** [January 7, 2019, 10:31am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/2 "2019-01-07T10:31:31Z")

</div>

@bellenot could you have a look, please?

---

<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:** [January 7, 2019, 10:44am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/3 "2019-01-07T10:44:44Z")

</div>

> [@luminociter](#):
>
> Anyway, trying to compile now same code that was running perfectly in root 5 I get the following error:
> 
> ```auto
> C:\WINDOWS\System32\KERNEL32.DLL : fatal error LNK1107: fichier non valide ou endommagé : impossible de lire à 0x2E0
> Error in <ACLiC>: Compilation failed!
> 
> ```

Can you post the complete output of the compilation?

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 7, 2019, 10:51am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/4 "2019-01-07T10:51:09Z")

</div>

Hi and thanks for the quick response!  
I guess you want the output of the root built. I am attaching the cmake error and output log files (converted the extensions to txt since the forum does not allow log files to be uploaded). Let me know if this is not what you meant.

[CMakeError.txt](https://root-forum.cern.ch/uploads/default/original/3X/3/b/3ba1b1326d2867538f53e13afa89c852fc0c75a8.txt) (218.5 KB)  
[CMakeOutput.txt](https://root-forum.cern.ch/uploads/default/original/3X/d/f/df14218562e7ec0dffd34d1e29e386ce4165b0e2.txt) (82.2 KB)

---

<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:** [January 7, 2019, 10:58am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/5 "2019-01-07T10:58:21Z")

</div>

Well, you said the compilation of ROOT was successful, right? Then I need the complete output of the compilation of the `code that was running perfectly in root 5`

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 7, 2019, 11:30am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/6 "2019-01-07T11:30:12Z")

</div>

Yes, I figured there would be a misunderstanding there, i guess it probably my fault. I am compiling on run time through a stearing macro using ACLIC passing these commands:

> gInterpreter-\>Reset(); // Reset Root  
> gInterpreter-\>AddIncludePath(“C:/Users/Luminociter/Desktop/HGTDUtils/”);  
> gInterpreter-\>LoadMacro(“C:/Users/Luminociter/Desktop/HGTDUtils/Root/HGTDUtils.cxx+”);

The only output i get is:

```auto
Info in <TWinNTSystem::ACLiC>: creating shared library C:/Users/Luminociter/Desktop/HGTDUtils/Root/HGTDUtils_cxx.dll
HGTDUtils_cxx_ACLiC_dict.cxx
   Création de la bibliothèque C:/Users/Luminociter/Desktop/HGTDUtils/Root\HGTDUtils_cxx.lib et de l'objet C:/Users/Luminociter/Desktop/HGTDUtils/Root\HGTDUtils_cxx.exp
C:\WINDOWS\System32\KERNEL32.DLL : fatal error LNK1107: fichier non valide ou endommagé : impossible de lire à 0x2E0
Error in <ACLiC>: Compilation failed!

```

I can nevertheless attach the intermediate objects ACLIC is generating if they are of any help.  
Thanks!

---

<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:** [January 7, 2019, 12:18pm UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/7 "2019-01-07T12:18:36Z")

</div>

OK, I’ll try. In the mean time, could you try to simply use ACLiC from the ROOT command prompt, something like:

```auto
root[0] .L HGTDUtils.cxx++

```

And let me know if you have the same issue

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 7, 2019, 1:10pm UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/8 "2019-01-07T13:10:49Z")

</div>

Same issue, no difference. Even more peculiar, if I write all the commands in a small steering macro that i made to compile my code while developing, it seems to ignore everything above line 13. Is it proof reading before executing at root 6?  
(I attach the macro[Run.C](https://root-forum.cern.ch/uploads/default/original/3X/6/e/6ef2d9a7c0c971a5c097e8c69ae5746432b73a24.C) (2.0 KB)  
)

---

<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:** [January 7, 2019, 1:43pm UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/9 "2019-01-07T13:43:37Z")

</div>

I cannot reproduce the error when compiling a macro with `gInterpreter->LoadMacro`. Can you try with another macro (e.g. one from the tutorials) to see if the error is always there?

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 7, 2019, 6:01pm UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/10 "2019-01-07T18:01:15Z")

</div>

I tried with the FFT.C macro from the tutorials/fft folder and the issue persists. I guess this is a setup issue and not a root 5 to root 6 specific issue. Is there a way to back trace if there was an issue with the build?  
Thanks,  
Vagelis

---

<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:** [January 8, 2019, 7:54am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/11 "2019-01-08T07:54:36Z")

</div>

Well, you can try to set the `gDebug` variable to something greater than zero to see if you have some useful printout, but I don’t think it will be useful if the issue is coming from your environment… Do you run from a `x86 Native Tools Command Prompt for VS 2017`?

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 8, 2019, 9:00am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/12 "2019-01-08T09:00:18Z")

</div>

Yes I do, i tried the gDebug method and this is a printout for the FFT macro:

> root [0] gDebug=1  
> (int) 1  
> root [1] .L C:/root/tutorials/fft/FFT.c+  
> Info in TWinNTSystem::ACLiC: creating shared library C:/root/tutorials/fft/FFT\_c.dll  
> Info in TWinNTSystem::Load: loaded library C:\root\bin\libHist.dll, status 0  
> Info in TWinNTSystem::Load: loaded library C:\root\bin\libGpad.dll, status 0  
> FFT\_c\_ACLiC\_dict.cxx  
> Création de la bibliothèque C:/root/tutorials/fft\FFT\_c.lib et de l’objet C:/root/tutorials/fft\FFT\_c.exp  
> C:\WINDOWS\System32\KERNEL32.DLL : fatal error LNK1107: fichier non valide ou endommagé : impossible de lire à 0x2E0  
> Error in : Compilation failed!  
> Info in TPluginManager::LoadHandlerMacros: C:\root\etc\plugins\TVirtualPad  
> Info in TPluginManager::FindHandler: found plugin for TPad  
> Info in TPluginManager::LoadHandlerMacros: C:\root\etc\plugins\TVirtualX  
> Info in TPluginManager::FindHandler: found plugin for TGWin32  
> Info in TWinNTSystem::Load: loaded library C:\root\bin\libWin32gdk.dll, status 0  
> Info in TInterpreter::TCling::AutoLoad: loaded library libWin32gdk.dll for TGWin32  
> Info in TPluginManager::LoadHandlerMacros: C:\root\etc\plugins\TGuiFactory  
> Info in TPluginManager::FindHandler: found plugin for TRootGuiFactory  
> Info in TWinNTSystem::Load: loaded library C:\root\bin\libGui.dll, status 0  
> Info in TInterpreter::TCling::AutoLoad: loaded library libGui.dll for TRootGuiFactory

It does not seem to show where things go wring…

---

<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:** [January 8, 2019, 9:11am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/13 "2019-01-08T09:11:24Z")

</div>

OK, trying to figure out where this could be coming from… Can you check the value of `MAKESHAREDLIB` in the `%ROOTSYS%\include\compiledata.h` header?

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 8, 2019, 9:39am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/14 "2019-01-08T09:39:14Z")

</div>

#define MAKESHAREDLIB “cl $Opt -nologo -TP -c -nologo -IC:/root/Source/v6.14.06/build/win -FIw32pragma.h -FIsehmap.h -MD -GR -EHsc- -W3 -wd4141 -wd4291 -wd4244 -wd4049 -D\_WIN32 -D\_XKEYCHECK\_H -D\_LIBCPP\_HAS\_NO\_PRAGMA\_SYSTEM\_HEADER -DNOMINMAX -D\_CRT\_SECURE\_NO\_WARNINGS -std=c++14 $IncludePath $SourceFiles -Fo$ObjectFiles && bindexplib $LibName $ObjectFiles \> $BuildDir\$LibName.def && lib -nologo -MACHINE:IX86 -out:$BuildDir\$LibName.lib $ObjectFiles -def:$BuildDir\$LibName.def && link -nologo $ObjectFiles -DLL -out:$BuildDir\$LibName.dll $BuildDir\$LibName.exp -LIBPATH:%ROOTSYS%\lib $LinkedLibs libCore.lib kernel32.lib advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib && if EXIST “$BuildDir\$LibName.dll.manifest” ( mt -nologo -manifest “$BuildDir\$LibName.dll.manifest” “-outputresource:$BuildDir\$LibName.dll;2” && del “$BuildDir\$LibName.dll.manifest” )”

---

<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:** [January 8, 2019, 9:41am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/15 "2019-01-08T09:41:28Z")

</div>

OK, this looks OK, there is no `KERNEL32.DLL` in the list. So I have no idea where this could come from…

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 8, 2019, 10:01am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/16 "2019-01-08T10:01:48Z")

</div>

The only reference of a kernel32.dll in root source files is at TWinNTSystem.cxx line 1512, if this is of any help…  
Ah, there is also a reference at RWMutex.inc at \interpreter\llvm\src\lib\Support\Windows\ line 50, and this is only in root 6, none of the previous version i checked…

---

<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:** [January 8, 2019, 10:05am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/17 "2019-01-08T10:05:23Z")

</div>

Well, there are several, but AFAICS they are not related to ACLiC…

---

<div class="post-metadata">

**Author:** ![luminociter](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/54ee81/32.png) [@luminociter](https://root-forum.cern.ch/u/luminociter)\
**Post date:** [January 14, 2019, 10:39am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/18 "2019-01-14T10:39:49Z")

</div>

OK just some later news after a bit of hassling around…  
I re-compiled root 6 from scratch with the latest CMake distribution and VS 2017 but the same problem remains. Then I uninstalled everything and tried one of the compiled binaries for windows from the webpage, and I still experience the same issue.  
Then i reinstalled root 5 (with VS2017 I might add) which works without any problem!  
This is specific to root 6, so there is an issue somewhere and is probably not related to my system. The only reason i need root 6 is because i need fftw and root 5 will not compile from source with my configuration correctly no matter how many different versions of cmake and vs studio i try.

---

<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:** [January 14, 2019, 10:54am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/19 "2019-01-14T10:54:21Z")

</div>

> [@luminociter](#):
>
> The only reason i need root 6 is because i need fftw and root 5 will not compile from source with my configuration correctly no matter how many different versions of cmake and vs studio i try.

FYI, ROOT 5 only compiles with at most VS 2013. Any more recent version is not supported.

---

<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:** [January 14, 2019, 10:55am UTC](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183/20 "2019-01-14T10:55:53Z")

</div>

BTW, you can also compile your code in the command line…

[Next page](https://root-forum.cern.ch/t/migrating-from-root-5-to-root-6-in-windows-10/32183.md?page=2)
