Hi @mroguljic ,
TL;DR:
I cannot reproduce the issue, I think we will need a minimal self-contained reproducer for your problem.
Given the following files:
// myclass.h
#ifndef MYCLASS
#define MYCLASS
struct MyClass { int data = -1; };
#endif
// foo.cpp
#include "myclass.h"
#include <ROOT/RDataFrame.hxx>
#include <TInterpreter.h>
#include <vector>
int main() {
gInterpreter->GenerateDictionary("MyClass;std::vector<MyClass>", "myclass.h");
{
ROOT::RDataFrame(10)
.Define("c",
[](ULong64_t e) {
return std::vector<MyClass>{{int(e)}, {int(e)}};
},
{"rdfentry_"})
.Snapshot<std::vector<MyClass>>("t", "f.root", {"c"});
TFile f("f.root");
auto *t = f.Get<TTree>("t");
t->Scan();
}
// with jitting
{
ROOT::RDataFrame(10)
.Define("c", [](ULong64_t e) { return std::vector<MyClass>{{int(e)}}; },
{"rdfentry_"})
.Snapshot<std::vector<MyClass>>("t", "f.root", {"c"});
TFile f("f.root");
auto *t = f.Get<TTree>("t");
t->Scan();
}
}
The following invocation works and produces the expected output both with ROOT master and with v6.24 installed via conda:
g++ -g -Wall -Wextra -Wpedantic -o "foo" "foo.cpp" $(root-config --cflags --libs) && ./foo
What am I doing differently?
Cheers,
Enrico