0

I'm using a framework called ROOT in my code, ROOT provides a large amount of libs, between then there is PROOF which should allow my code run in parallel.

Should be defined in TProof.h a static method Open that starts the parallel environment. I'm using this method as the following:

//usual includes (including ROOT's)
#include 
//lots of code
int main(int argc, const char *argv[])   {
    //Initialization code
    TProof *p = TProof::Open("");
    // more code
    return 0;
}

g++ gives me this error:

mini2.o: In function `main':
/path/to/file/name.cxx:279: undefined reference to `TProof::Open(char const*, char const*, char const*, int)'

ROOT provides a script that prints all the necessary flags to compile and link its libs, I'm using those flags, in this case:

$ root-config --libs
-L/my/path/root/lib -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread -pthread -lm -ldl -rdynamic

What I'm doing wrong? How can I solve it?

RSFalcon7
  • 2,241
  • 6
  • 34
  • 55
  • 1
    The error you're getting is a linker error, not a compiler error. `TProof.h` is found by the compiler (otherwise that step would fail already), but you seem to have forgotten to *link* against the relevant libraries. – us2012 Feb 04 '13 at 22:25
  • I'm linking with all the necessary libraries, at least ROOT think so. – RSFalcon7 Feb 04 '13 at 23:28
  • Either way, I edited the question, it should be a bit clearer. – RSFalcon7 Feb 04 '13 at 23:32

1 Answers1

1

You are missing at least -lProof in your compiler (linker) options. I don't really know the framework, so I can't tell you whether this is your fault or a problem with the configuration script.

(This is how I found out: Downloaded the binary distribution of ROOT, checked the lib folder and found libProof.so.)

If this is not enough, include the other Proof* libraries you can find in the library directory.

us2012
  • 16,083
  • 3
  • 46
  • 62