# VS project does not work with libCore.dll in release folder

**URL:** <https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929>\
**Category:** Newbie\
**Created:** [October 20, 2020, 1:36pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929 "2020-10-20T13:36:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mana](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mana/32/23552_2.png) [@Mana](https://root-forum.cern.ch/u/Mana)\
**Post date:** [October 20, 2020, 1:36pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/1 "2020-10-20T13:36:27Z")

</div>

Dear ROOTers,

new post, new problem! So I finally managed to set up the first basic version of my code and managed to run it on my computer. Yep, just on mine. Now I would like to be able to run it on other windows computers that might not have neither ROOT (heretics!) nor VS.

My project is a C++ windows form and (I think) I need the option /clr to compile it, which does not allow me to automatically generate an executable version with all the .dll dependencies (in other words I have to use /MD and /MDd options).

Thus, as I understand, I have to provide the “release” folder generated from VS together with all the .dll needed.

Long story short, I’ve made several attempts and found out that:

- On my computer (with ROOT and VS)

I can take the “release” folder and make it run wherever I place it (of course, as I have all the libraries). But, as soon as I add “libCore.dll” in the same folder, the executable doesn’t work anymore: I can click it and nothing happens.  
This happens only with “libCore.dll”, the executable still works fine with all the other ROOT .dll files

- On other computers (no ROOT, no VS)

My program doesn’t work because they’re missing the libraries, and, as soon as I provide “libCore.dll” in the “release” folder, the executable behaves just like on my computer.  
A really basic version of the code (i.e. just the windows form without any code using ROOT) works just fine. Thus I think we can exclude a .NET Framework issue.

What would you suggest? Is this an issue anyone has experienced before?

Thank you so much,  
Filippo

* * *

_ROOT Version:_ v6.22.02  
_Platform:_ Windows 10  
_Compiler:_ Microsoft Visual Studio Community 2019 (Version 16.7.4)

* * *

---

<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:** [October 20, 2020, 1:51pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/2 "2020-10-20T13:51:27Z")

</div>

To make it short: running a ROOT application requires more than just its DLLs. There are icons, plugins and so on located in different folders relative to the `ROOTSYS` environment variable which should point to where ROOT has been installed.

---

<div class="post-metadata">

**Author:** ![Mana](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mana/32/23552_2.png) [@Mana](https://root-forum.cern.ch/u/Mana)\
**Post date:** [October 20, 2020, 1:59pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/3 "2020-10-20T13:59:11Z")

</div>

So, I guess that means that there’s no way to get a precompiled program that uses ROOT libraries to work on a computer that has not ROOT installed?

---

<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:** [October 20, 2020, 2:01pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/4 "2020-10-20T14:01:22Z")

</div>

Well, there are always several solution to a given problem, it it might be more complicated than simply installing ROOT. But you can try nevertheless. And if you search the forum you may even find someone who already tried…

---

<div class="post-metadata">

**Author:** ![Mana](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mana/32/23552_2.png) [@Mana](https://root-forum.cern.ch/u/Mana)\
**Post date:** [October 20, 2020, 2:10pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/5 "2020-10-20T14:10:59Z")

</div>

Fair enough, thank you for the explanation. I’ll look deeper into it.

But, if I may, I’m still confused about the issue I’m having on my computer (i.e. when “libCore.lib” to the “release folder”), any idea why that could happen?

---

<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:** [October 20, 2020, 2:25pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/6 "2020-10-20T14:25:50Z")

</div>

I’ll check, but it might be related to some initialization requiring libCore.dll to be in `%ROOTSYS%\bin`

---

<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:** [October 20, 2020, 2:48pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/7 "2020-10-20T14:48:00Z")

</div>

So the system (in `libCore.dll`) looks for the `etc` directory in `%ROOTSYS%`, then the `bin` directory to add it in the `PATH`…

---

<div class="post-metadata">

**Author:** ![Mana](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mana/32/23552_2.png) [@Mana](https://root-forum.cern.ch/u/Mana)\
**Post date:** [October 22, 2020, 1:24pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/8 "2020-10-22T13:24:47Z")

</div>

Sorry for the delay, I got pretty busy in these days.

Ok, so I might have an issue here. If I look on my computer for the variable ROOTSYS

```auto
echo %ROOTSYS%

```

the output is just %ROOTSYS%, which, I would guess, means that the variable is not defined.  
The ROOT `bin` directory is, instead already in `PATH`. Unlike `etc` which is not.  
I’ll look how to properly define ROOTSYS on windows and try again

---

<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:** [October 22, 2020, 1:27pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/9 "2020-10-22T13:27:22Z")

</div>

The `%ROOTSYS%` and `%PATH%` environment variables are set/modified by the `thisroot.bat` script (located in the `ROOT` `bin` directory)

---

<div class="post-metadata">

**Author:** ![Mana](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mana/32/23552_2.png) [@Mana](https://root-forum.cern.ch/u/Mana)\
**Post date:** [October 22, 2020, 1:39pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/10 "2020-10-22T13:39:39Z")

</div>

Thanks!  
I tried to run `thisroot.bat` using cmd as administrator. When I write `echo %ROOTSYS%` in the same session I get the correct folder, but after I close and reopen cmd the variable is not defined anymore.  
Is this normal?

The same happens if I just execute `thisroot.bat` without udsing the command line

---

<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:** [October 22, 2020, 1:51pm UTC](https://root-forum.cern.ch/t/vs-project-does-not-work-with-libcore-dll-in-release-folder/41929/11 "2020-10-22T13:51:34Z")

</div>

> [@Mana](#):
>
> I tried to run `thisroot.bat` using cmd as administrator. When I write `echo %ROOTSYS%` in the same session I get the correct folder, but after I close and reopen cmd the variable is not defined anymore.  
> Is this normal?

Yes, this is valid for the current session only

But you can also set those values on your computer in your `computer properties` → `advanced system settings` → `environment variables`
