Thanks: all the flags seem to be there, as expected.
Could you try to add -L /home/ssun/Projects/root/install/lib to point the linker to the directory where the libraries can be found?
I don’t understand what do you mean…it was already in my r++ command, do you mean you want me to try to add -L /home/ssun/Projects/root/install/lib outside r++ command which means it will be called twice?
By the way, I tried but get the same errors as before…
I see the path now, sorry.
This could be related to your setup. Have you tried to build a very simple executable that just creates a histogram and does something with it to avoid the compiler optimizes it away (e.g. print its title)?
We could start debugging from something very simple.
#include <TFile.h>
int main(){
TFile* f = new TFile("test.root");
return 0;
}
then compile it with r++ command above, then gives me the same error:
/usr/bin/ld: /tmp/ccBIkmYY.o: in function `main':
test.cxx:(.text+0x40): undefined reference to `TFile::TFile(char const*, char const*, char const*, int)'
/usr/bin/ld: test.cxx:(.text+0x60): undefined reference to `TObject::operator delete(void*)'
/usr/bin/ld: /tmp/ccBIkmYY.o: in function `__static_initialization_and_destruction_0(int, int)':
test.cxx:(.text+0xb8): undefined reference to `TVersionCheck::TVersionCheck(int)'
/usr/bin/ld: /tmp/ccBIkmYY.o: in function `TObject::operator new(unsigned long)':
test.cxx:(.text._ZN7TObjectnwEm[_ZN7TObjectnwEm]+0x10): undefined reference to `TStorage::ObjectAlloc(unsigned long)'
collect2: error: ld returned 1 exit status
please notice that when I use root -l to enter the interactive mode I can create TFile without error, and the error above indicate that include files are successfully loaded only libs are not.
Well, I also reached my EOL but, even though ROOT doesn’t have my “subscription”, here it is.
Replace your “alias” with this “function” (and re-login):
I think this is caused by incorrectly loading the libs, is there a way to check if root-config is loading libs from the correct path and correct name of files?
seems that libs must be loaded after source code been compiled, but it was not necessary at any other machine such as MacOS and CentOS…
So I think only Ubuntu or Debian based system will have such problem?