Problem with main() and no output root file

By running and with data.root, I should make analyzetree.root output file, but it seems the code is not working and I don’t see any error. Please give me your insight. (2.5 KB)

Please read tips for efficient and successful posting and posting code

ROOT Version: root_v5.34.36
Platform: Windows
Compiler: Emacs

Uploading: data.root…
data.root file too big to be upload.
here is the link * Download example data tree: [root]

One cannot try your code without “particle_tree.h”.
But first, make sure that you do not get any errors or warnings from:

`root-config --cxx --cflags` -Wall `root-config --libs`

particle_tree.h (2.0 KB)
Here is “particle_tree.h”

Fix your source code.

[...]$ `root-config --cxx --cflags` -Wall `root-config --libs`
/usr/bin/ld: /tmp/ccykh63G.o: in function `main': undefined reference to `particle_tree::particle_tree(char const*)'
/usr/bin/ld: undefined reference to `particle_tree::GetEntry(long long)'
/usr/bin/ld: undefined reference to `particle_tree::~particle_tree()'
/usr/bin/ld: undefined reference to `particle_tree::~particle_tree()'
collect2: error: ld returned 1 exit status

I changed the name of to with little bit modifying such as from exe/analyzetree.exe <No. events to analyze>
exe/analyzetree.exe data.root analyzetree.root 1000
Here is the raw (2.5 KB)

The problem is not the “main” routine but the missing implementations of the “particle_tree” class methods.

analyzetree.tgz (7.5 KB)
here is the everything the file contain except data.root. Is there still error?

In the “” file, instead of:

#define particle_tree_cxx
#include "particle_tree.h"


#include "particle_tree.C"

Are there any other things I should know. When I run this code, word usage appear and root quits.

It is not a ROOT macro. It is a “standalone application”. You must learn how to compile and run executables on your system.