Std::vector of pointers?

I tested the following macro:

// test.C

#include
#include <TH1F.h>

void test()
{
std::vector<TH1F*> vh;
}

The results are as follows. The error occurs only from the 2nd execution.

$ root -l
root [0] .x test.C
root [1] .x test.C
IncrementalExecutor::executeFunction: symbol ‘_ZSt8_DestroyIPP4TH1FS1_EvT_S3_RSaIT0_E’ unresolved while linking [cling interface function]!
You are probably missing the definition of void std::_Destroy<TH1F**, TH1F*>(TH1F**, TH1F**, std::allocator<TH1F*>&)
Maybe you need to load the corresponding shared library?
root [2]

Is this a known issue? I am using ROOT 6.12.

This seems to be an issue with executing the same macro multiple times, which is always a bit tricky.
Maybe @Axel knows what’s up.

Hi tyoshiko, yes this is one of the most annoying bugs of the current ROOT - it’s inability to re-run lots of code, especially when it uses templates. I’ll be working on this in 2018…
Cheers, Axel.

2 Likes

You could try loading the macro (with .L), then calling the function.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.