Some more attempt :
Putting this “-I/home/alexandre/ROOT/v6-06-06/include” into compiler options (which seems to be equivalent to putting “/home/alexandre/ROOT/v6-06-06/include” into Search directories->Compiler) give me this warning :
#error This file requires compiler and library support for the forthcoming \
ISO C++ 2014 standard. This support is currently experimental, and must be \
enabled with the -std=c++1y or -std=gnu++1y compiler options.
Then, I ticked the C++14 ISO (instead of C++11) into Compiler flags->General (equivalent to adding -std=c++1y into compiler options) and I get a lot of “undefined reference to …” beginning with :
Here are the compilation options in the Build log :
Here is the piece of code which cause the error : [code]
TH1D* Dessin(vec &V,const char * xtitre,const char * ytitre,double xmin,double xmax,const char * titre, int superp,const char *opt,double ymin, double ymax,int col,int opt_log)
{
//... recherche si il y a deja une fenetre "titre"...
TCanvas *c=(TCanvas*)gROOT->GetListOfCanvases()->FindObject(titre); // PROBLEM HERE
if (c==0) // il n'y en a pas déjà, crée nouvelle fenetre
{
// cout<<“cree nouvelle fenetre dans vecteur.cc, titre=”<<titre<<endl;
c = new TCanvas(titre,titre,400,400);
c->SetFillColor(0);
superp=0;
}
else
{
// cout<<“fenetre deja existante:”<<titre<<endl;
}
return Dessin(V,xtitre, ytitre,xmin, xmax, titre, c,superp,opt,ymin,ymax,col,opt_log);
}[/code]
Here is the full build log :
g++ -Wall -fexceptions -g -std=c++14 -larmadillo -I/home/alexandre/ROOT/v6-06-06/include -c /home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc -o obj/Debug/divers.o
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc: In function ‘int Recherche_indice_du_max(arma::vec&)’:
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:164:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc: In function ‘arma::vec Permut_circ2(arma::vec&, int)’:
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:175:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i=0;i<V.size();i++)
^
g++ -o bin/Debug/program5 obj/Debug/divers.o obj/Debug/main.o obj/Debug/signal.o obj/Debug/sound2.o
obj/Debug/divers.o: In function `Dessin(arma::Col<double>&, char const*, char const*, double, double, char const*, int, char const*, double, double, int, int)':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:42: undefined reference to `ROOT::GetROOT()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:46: undefined reference to `TCanvas::TCanvas(char const*, char const*, int, int)'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:46: undefined reference to `TObject::operator delete(void*)'
obj/Debug/divers.o: In function `Dessin(arma::Col<double>&, char const*, char const*, double, double, char const*, TCanvas*, int, char const*, double, double, int, int)':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:78: undefined reference to `ROOT::GetROOT()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:87: undefined reference to `TH1D::TH1D(char const*, char const*, int, double, double)'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/divers.cc:87: undefined reference to `TObject::operator delete(void*)'
obj/Debug/divers.o: In function `__static_initialization_and_destruction_0(int, int)':
/home/alexandre/ROOT/v6-06-06/include/TVersionCheck.h:34: undefined reference to `TVersionCheck::TVersionCheck(int)'
obj/Debug/divers.o: In function `TObject::operator new(unsigned long)':
/home/alexandre/ROOT/v6-06-06/include/TObject.h:158: undefined reference to `TStorage::ObjectAlloc(unsigned long)'
obj/Debug/divers.o: In function `TCanvasImp::IsA() const':
/home/alexandre/ROOT/v6-06-06/include/TCanvasImp.h:80: undefined reference to `TCanvasImp::Class()'
obj/Debug/divers.o: In function `TCanvasImp::ShowMembers(TMemberInspector&) const':
/home/alexandre/ROOT/v6-06-06/include/TCanvasImp.h:80: undefined reference to `TCanvasImp::Class()'
/home/alexandre/ROOT/v6-06-06/include/TCanvasImp.h:80: undefined reference to `ROOT::Class_ShowMembers(TClass*, void const*, TMemberInspector&)'
obj/Debug/divers.o:(.rodata._ZTV10TCanvasImp[_ZTV10TCanvasImp]+0x100): undefined reference to `TCanvasImp::Streamer(TBuffer&)'
obj/Debug/main.o: In function `main':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/main.cc:13: undefined reference to `TApplication::TApplication(char const*, int*, char**, void*, int)'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/main.cc:17: undefined reference to `TApplication::Run(bool)'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/main.cc:13: undefined reference to `TApplication::~TApplication()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/main.cc:13: undefined reference to `TApplication::~TApplication()'
obj/Debug/main.o: In function `__static_initialization_and_destruction_0(int, int)':
/home/alexandre/ROOT/v6-06-06/include/TVersionCheck.h:34: undefined reference to `TVersionCheck::TVersionCheck(int)'
obj/Debug/main.o: In function `TApplicationImp::~TApplicationImp()':
/home/alexandre/ROOT/v6-06-06/include/TApplicationImp.h:39: undefined reference to `TString::~TString()'
obj/Debug/main.o: In function `TApplicationImp::IsA() const':
/home/alexandre/ROOT/v6-06-06/include/TApplicationImp.h:52: undefined reference to `TApplicationImp::Class()'
obj/Debug/main.o: In function `TApplicationImp::ShowMembers(TMemberInspector&) const':
/home/alexandre/ROOT/v6-06-06/include/TApplicationImp.h:52: undefined reference to `TApplicationImp::Class()'
/home/alexandre/ROOT/v6-06-06/include/TApplicationImp.h:52: undefined reference to `ROOT::Class_ShowMembers(TClass*, void const*, TMemberInspector&)'
obj/Debug/main.o:(.rodata._ZTV15TApplicationImp[_ZTV15TApplicationImp]+0x80): undefined reference to `TApplicationImp::Streamer(TBuffer&)'
obj/Debug/signal.o: In function `Signal::Calcule_Correlation(arma::Col<double>&, double)':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:276: undefined reference to `TLine::TLine(double, double, double, double)'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:280: undefined reference to `TVirtualPad::Pad()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:276: undefined reference to `TObject::operator delete(void*)'
obj/Debug/signal.o: In function `Signal::Dessin_TF()':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:495: undefined reference to `TVirtualPad::Pad()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:498: undefined reference to `ROOT::GetROOT()'
obj/Debug/signal.o: In function `Signal::TF_phases_aleatoires()':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:609: undefined reference to `gRandom'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:609: undefined reference to `gRandom'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:615: undefined reference to `gRandom'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:615: undefined reference to `gRandom'
obj/Debug/signal.o: In function `Signal::TF_var_signal()':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:986: undefined reference to `gRandom'
obj/Debug/signal.o:/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/signal.cc:986: more undefined references to `gRandom' follow
obj/Debug/signal.o: In function `__static_initialization_and_destruction_0(int, int)':
/home/alexandre/ROOT/v6-06-06/include/TVersionCheck.h:34: undefined reference to `TVersionCheck::TVersionCheck(int)'
obj/Debug/sound2.o: In function `Com_Sound::Com_Sound()':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:31: undefined reference to `TGClient::Instance()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:31: undefined reference to `TGClient::GetRoot() const'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:31: undefined reference to `TGMainFrame::TGMainFrame(TGWindow const*, unsigned int, unsigned int, unsigned int)'
obj/Debug/sound2.o: In function `Com_Sound::Com_Sound()':
/home/alexandre/ROOT/v6-06-06/include/TGButton.h:180: undefined reference to `TGButton::GetDefaultGC()'
obj/Debug/sound2.o: In function `Com_Sound::Com_Sound()':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:52: undefined reference to `TGGC::operator()() const'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:52: undefined reference to `TGTextButton::GetDefaultFontStruct()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:52: undefined reference to `TGTextButton::TGTextButton(TGWindow const*, char const*, int, unsigned long, unsigned long, unsigned int)'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:61: undefined reference to `TGFrame::GetDefaultFrameBackground()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:61: undefined reference to `TRootEmbeddedCanvas::TRootEmbeddedCanvas(char const*, TGWindow const*, unsigned int, unsigned int, unsigned int, unsigned long)'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:62: undefined reference to `TGCompositeFrame::AddFrame(TGFrame*, TGLayoutHints*)'
obj/Debug/sound2.o: In function `Com_Sound::Com_Sound()':
/home/alexandre/ROOT/v6-06-06/include/TGButton.h:180: undefined reference to `TGButton::GetDefaultGC()'
obj/Debug/sound2.o: In function `Com_Sound::Com_Sound()':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:78: undefined reference to `TGGC::operator()() const'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:78: undefined reference to `TGTextButton::GetDefaultFontStruct()'
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:78: undefined reference to `TGTextButton::TGTextButton(TGWindow const*, char const*, int, unsigned long, unsigned long, unsigned int)'
obj/Debug/sound2.o: In function `Com_Sound::Com_Sound()':
/home/alexandre/ROOT/v6-06-06/include/TGButton.h:180: undefined reference to `TGButton::GetDefaultGC()'
obj/Debug/sound2.o: In function `Com_Sound::Com_Sound()':
/home/alexandre/Desktop/MathMusiqueInfo/Stage/program5/sound2.cc:88: undefined reference to `TGGC::operator()() const'