TSelector compiling issue - undefined reference

Hi all!

Using TreeName->MakeSelector(“selectorname”) and trying to use this selector in some code that I’d like to compile via g++ I encounter a strange problem, with following error message:

This happens when linking, but only when I’m doing the linking using intermediate *.o files.
You can easily reproduce this behaviour:
[li] create a selector from a root tree that’s available to you, name it “selector” (load the root file, then do a TreeName->MakeSelector("selector")
edit the “selector.h” and add the following include lines:

#include <vector> #include <string> using std::string; using std::vector; [/li]
[li] create a file “main.C” with following content

#include <TChain.h>
#include “selector.h”

int main( int argc, char* argv[] ) {
TChain* chain = new TChain(“YOURROOTFILE.root”);
selector* myselector = (selector*) TSelector::GetSelector(“selector.C+”);
[li] produce the object code

and link these files

The strange this is, when compiling and linking with

Anybody knows help?

I also searched the forum and all I could find was this thread, but I couldn’t really figure out, how it could help in my case:
[url]Undefined symbol when using macro code in Selector

I would appreciate any kind of help!


You need to generate, compile and link a dictionary for the selector class.