Home | News | Documentation | Download

Undefined reference to TString::TString

Does anyone know how to fix the following error?

Compiling…

/tmp/lurda/ccoTygUM.o: In function `HISTS::Save(TopAnalysis&, SAMPLES const&, ASCII&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':

analysis_example.C:(.text._ZN5HISTS4SaveER11TopAnalysisRK7SAMPLESR5ASCIIRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESE_SE_SE_[_ZN5HISTS4SaveER11TopAnalysisRK7SAMPLESR5ASCIIRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESE_SE_SE_]+0xae): undefined reference to `TString::TString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

/tmp/lurda/cc1T8mrU.o: In function `CMSAnalysis::SetTreeFile(int, int)':

CMSAnalysisLU.C:(.text+0x35c6): undefined reference to `TString::TString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

/tmp/lurda/ccQ9V2V4.o: In function `FICH::Readingtxtfiles(char const*)':

SamplesClassLU.C:(.text+0x379): undefined reference to `TString::TString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

SamplesClassLU.C:(.text+0x420): undefined reference to `TString::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

SamplesClassLU.C:(.text+0x43d): undefined reference to `TString::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

SamplesClassLU.C:(.text+0x45a): undefined reference to `TString::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

collect2: error: ld returned 1 exit status

Compilation done.

You need to show the command line which produces this error.

./cmsAnalysisRunLU analysis_example.C

g++ -std=gnu++0x -I${ROOTINCDIR} {fileC} CMSAnalysisLU.C SamplesClassLU.C {ROOTLIBS} -lX11 -o ${fileEXE}

Try:

`root-config --cxx --cflags` analysis_example.C CMSAnalysisLU.C SamplesClassLU.C `root-config --libs` -o myexe 

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