RSFalcon7
RSFalcon7

Reputation: 2311

undefined reference to Class::method()

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?

Upvotes: 0

Views: 783

Answers (1)

us2012
us2012

Reputation: 16253

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.

Upvotes: 1

Related Questions