Undefined reference in TSpectrum (2)

Hello Rooters!

I have the same problem like in here, so sorry if it will be the duplicate, but solution from this link doesn’t work for me
Let’s see on my case, please:

17:04:07|bdrum@nf-100-211:Cpp>> cat testRoot.cpp 

int main() {
  auto sp = new TSpectrum();
  return 0;
17:04:10|bdrum@nf-100-211:Cpp>> g++ `root-config --glibs --cflags --libs` -lSpectrum -o run testRoot.cpp 
/tmp/ccJbrONX.o: In function `main':
testRoot.cpp:(.text+0x1c): undefined reference to `TSpectrum::TSpectrum()'
testRoot.cpp:(.text+0x5a): undefined reference to `TObject::operator delete(void*)'
/tmp/ccJbrONX.o: In function `__static_initialization_and_destruction_0(int, int)':
testRoot.cpp:(.text+0xc5): undefined reference to `TVersionCheck::TVersionCheck(int)'
/tmp/ccJbrONX.o: In function `TObject::operator new(unsigned long)':
testRoot.cpp:(.text._ZN7TObjectnwEm[_ZN7TObjectnwEm]+0x14): undefined reference to `TStorage::ObjectAlloc(unsigned long)'
collect2: error: ld returned 1 exit status

#as you can see here - I have libSpectrum (also I added -L flag with this path, but result was the same)
17:04:23|bdrum@nf-100-211:Cpp>> find /usr/local/lib/ -name *Spec*

Do you have any idea how to fix it and what name of library (like -lSpectrum) for Minuit2, how can I include it?


ROOT Version: 6.15/01
Platform: Ubuntu 18.04
Compiler: g++ 7.3.0.

`root-config --cxx --cflags` -o run testRoot.cpp `root-config --libs` -lSpectrum -lMinuit2

Ah, the problem was in order of flags, yes.
Many thanks!

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