Hi,
I’d like to access data in a ROOT file from a standalone application.
I’m basically doing what’s in the test code below which I compile with :
g++ -g -Wall -o test test.cpp -I$HOME_WAT/include" -L$HOME_WAT/lib -Wl,-static -lwavelet -Wl,-Bdynamic root-config --cflags --glibs
I receive a segmentation violation. See full transcript at the end of the message.
inputfile.Get(“V1:4”) returns NULL but the data is there! When I run test() in
interactive mode, everything goes fine.
Any help would be greatly appreciated!
Eric
# include <iostream>
#include "TFile.h"
#include "wseries.hh"
using namespace std;
void test()
{
TFile inputfile("file.root");
inputfile.ls();
WSeries<double>* wavelet_transform = (WSeries<double>*)inputfile.Get("V1:4");
cout << wavelet_transform->size() << endl;
}
# ifndef __CINT__
int main()
{
test();
return 0;
}
# endif
ecm@titan1:~/graph$ ./test
Warning in TUnixSystem::SetDisplay: DISPLAY not set, setting it to XXXXX:0.0
Warning in TClass::TClass: no dictionary for class slice is available
Warning in TClass::TClass: no dictionary for class WDM is available
Warning in TClass::TClass: no dictionary for class Wavelet is available
Warning in TClass::TClass: no dictionary for class SymmObjArray<SymmArraySSE > is available
Warning in TClass::TClass: no dictionary for class SymmArraySSE is available
TFile** file.root
TFile* file.root
KEY: WSeries L1:8;1
KEY: WSeries H1:8;1
KEY: WSeries V1:8;1
KEY: WSeries L1:7;1
KEY: WSeries H1:7;1
KEY: WSeries V1:7;1
KEY: WSeries L1:6;1
KEY: WSeries H1:6;1
KEY: WSeries V1:6;1
KEY: WSeries L1:5;1
KEY: WSeries H1:5;1
KEY: WSeries V1:5;1
KEY: WSeries L1:4;1
KEY: WSeries H1:4;1
KEY: WSeries V1:4;1
KEY: WSeries L1:3;1
KEY: WSeries H1:3;1
KEY: WSeries V1:3;1
Error in TKey::ReadObj: Unknown class WSeries
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
stat_loc=0x7fff48dcda5c, options=<value optimized out>)
at ../sysdeps/unix/sysv/linux/waitpid.c:32