# Problem with Class Event

**URL:** <https://root-forum.cern.ch/t/problem-with-class-event/38677>\
**Category:** Newbie\
**Created:** [April 3, 2020, 4:30am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677 "2020-04-03T04:30:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 4:30am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/1 "2020-04-03T04:30:04Z")

</div>

Hello

I’m new to ROOT. I want to run examples of tutorials (tree), but when I try to run tree4.C I get this:

Error: cannot open file “…/test/libEvent.dll”

how can I fix this?

I use root\_v5.32.36 on windows7.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2020, 6:11am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/2 "2020-04-03T06:11:16Z")

</div>

Can you tell how you are running `tree4.C` ? In principal it should be no problem. As it seems a windows issue @bellenot can help you I guess.

---

<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:** [April 3, 2020, 6:33am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/3 "2020-04-03T06:33:31Z")

</div>

> [@pure](#):
>
> Error: cannot open file “…/test/libEvent.dll”
> 
> how can I fix this?
> 
> I use root\_v5.32.36 on windows7.

First, I suppose you meant root\_v5.34.36. Then, if the `…/test/libEvent.dll` doesn’t exist, you can try to open a Visual Studio command prompt, go to the test directory, and type `nmake -f Makefile.win32` to build the missing applications/dlls. And I hope you have a version of Visual studio matching the one used to build ROOT (VS 2012 or 2013)…

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 12:53pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/4 "2020-04-03T12:53:18Z")

</div>

Thanks. yes, it’s root\_v5.34.36. I have VS 2013. I tried “nmake -f Makefile.win32” but I get this error:

 ![makefile](https://root-forum.cern.ch/uploads/default/original/3X/0/0/005db3d95fb615e2e2153acb4a5228be36c8af79.png)

---

<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:** [April 3, 2020, 1:01pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/5 "2020-04-03T13:01:00Z")

</div>

OK, I can’t try right now (ROOT 5 is too old…), but try to remove `-FIw32pragma.h` from `Makefile.wi32`. I.e.:

```auto
CXXFLAGS = -nologo -EHs -GR -DWIN32 -W3 -D_WIN32 -D_WINDOWS \
                -I$(ROOTSYS)/include -wd4244 \
                -FIw32pragma.h

```

Should be:

```auto
CXXFLAGS = -nologo -EHs -GR -DWIN32 -W3 -D_WIN32 -D_WINDOWS \
                -I$(ROOTSYS)/include -wd4244

```

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 1:19pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/6 "2020-04-03T13:19:11Z")

</div>

I removed `-FIw32pragma.h` but still I get error:

 ![nmake](https://root-forum.cern.ch/uploads/default/original/3X/0/6/0679162a600fc63e1b6f7d6bb578628238b19348.png)

---

<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:** [April 3, 2020, 1:21pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/7 "2020-04-03T13:21:05Z")

</div>

You have to call `root\bin\thisroot.bat` before typing `nmake -f Makefile.win32`  
(or probably `..\bin\thisroot.bat` from the `test` directory…)

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 1:23pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/8 "2020-04-03T13:23:31Z")

</div>

Am I do it right?  
 ![bat](https://root-forum.cern.ch/uploads/default/original/3X/7/e/7eed19670d1b6a9ebd0db1bf9f8f318889ca4eb3.png)

---

<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:** [April 3, 2020, 1:24pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/9 "2020-04-03T13:24:32Z")

</div>

No. Sorry, I edited my previous reply, just take a look at it again

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 1:28pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/10 "2020-04-03T13:28:32Z")

</div>

No, thisroot.bat file is in root\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:** [April 3, 2020, 1:30pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/11 "2020-04-03T13:30:30Z")

</div>

Yes, then just execute it

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 1:35pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/12 "2020-04-03T13:35:36Z")

</div>

Ok, I get these:

 ![1](https://root-forum.cern.ch/uploads/default/original/3X/b/a/ba8220ef1bb4aee9e186ce4e8e19d53d58b0260f.png)  
 ![2](https://root-forum.cern.ch/uploads/default/original/3X/d/9/d9f80119bfa9b822453f650c50edc2f7334a908a.png)

---

<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:** [April 3, 2020, 1:43pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/13 "2020-04-03T13:43:55Z")

</div>

Well, ok, but now, at least, you have the `libEvent.dll` you were looking for. Or do you want everything in the test directory?

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 1:49pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/14 "2020-04-03T13:49:02Z")

</div>

Thank you very much. I can run tree4.C now.

---

<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:** [April 3, 2020, 1:52pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/15 "2020-04-03T13:52:43Z")

</div>

Good! And you’re welcome!

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 3, 2020, 2:00pm UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/16 "2020-04-03T14:00:01Z")

</div>

Thank you very much for your help and kindness.

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 23, 2020, 7:31am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/17 "2020-04-23T07:31:08Z")

</div>

Hello!  
I have another problem in executing Event. I’m following the tutorial, section Using `TTree:: MakeClass`, I want to create Event.root file using:

```auto
> $ROOTSYS/test/Event 400 1 2 1

```

I get this Error:

> Error: Invalid type ‘Event’ in declaration of ‘400 1 2 1’ (tmpfile)(1)  
> Error: Symbol Event 400 1 2 1 is not defined in current scope (tmpfile)(1)

I’m using ROOT V\_5.34.38 on Windows.Hello!  
I have anothor problem in excecuting Event. I’m following the tutorial, section Using TTree::MakeClass, I want to create Event.root file using:

```auto
> $ROOTSYS/test/Event 400 1 2 1

```

I get this Error:

> Error: Invalid type ‘Event’ in declaration of ‘400 1 2 1’ (tmpfile)(1)  
> Error: Symbol Event 400 1 2 1 is not defined in current scope (tmpfile)(1)

Am I doing it wrong?

I work with ROOT on windows.

---

<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:** [April 23, 2020, 8:41am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/18 "2020-04-23T08:41:43Z")

</div>

Can you describe exactly what you did to obtain this error?  
For example, from where / how did you call this:

> [@pure](#):
>
> ```auto
> > $ROOTSYS/test/Event 400 1 2 1
> 
> ```

And BTW, please don’t reply to an old (and unrelated) topic, but open a new one instead…

---

<div class="post-metadata">

**Author:** ![pure](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/3ab097/32.png) [@pure](https://root-forum.cern.ch/u/pure)\
**Post date:** [April 24, 2020, 1:26am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/19 "2020-04-24T01:26:16Z")

</div>

I just write it in the ROOT:

```auto
root [0] Event 400 1 2 1
Error: Invalid type 'Event' in declaration of '400 1 2 1' (tmpfile)(1)
Error: Symbol Event 400 1 2 1 is not defined in current scope (tmpfile)(1)

```

in the command promot I get this:

```auto
C:\root\test>Event 400 1 2 1
'Event' is not recognized as an internal or external command,
operable program or batch file.

```

---

<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:** [April 24, 2020, 6:41am UTC](https://root-forum.cern.ch/t/problem-with-class-event/38677/20 "2020-04-24T06:41:02Z")

</div>

Neither of those are the proper way of using the Event example. If you look at the comments in the `Event.cxx` file, you can read:

```auto
/ An example of a batch program to use the Event/Track classes is given
// in this directory: MainEvent.
// Look also in the same directory at the following macros:
// - eventa.C an example how to read the tree
// - eventb.C how to read events conditionally

```

(you can take a look at the `test/eventa.cxx` and `test/eventb.cxx` files). or on the command line, you can use the `eventexe` executable (created with the `MainEvent.cxx` source file). On Windows, you will have to rename it `event.exe` or `eventexe.exe` (this issue will be fixed shortly in the `master`)
