Root compilation error on Ubuntu 12.04

Dear Experts,

I have been trying to install root on Ubuntu 12.04. After unsuccessful try using precompiled version for my OS I decided to build root from the source. I cloned repository, switched to actual stable, according to the realise note, branch I configured and stared building. See the history log

2028 git checkout -b v6-04-14 v6-04-14 2029 git status 2030 ./configure 2031 make
Unfortunately, the compilation error occurred. See log below.

-c /home/ja/.root6/root/gui/gui/src/TGButton.cxx /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In destructor ‘virtual TGButton::~TGButton()’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:178:21: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete] if (fTip) delete fTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:178:21: warning: invalid use of incomplete type ‘class TGToolTip’ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: warning: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:178:21: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined if (fTip) delete fTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGButton::HandleButton(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:283:18: error: invalid use of incomplete type ‘class TGToolTip’ if (fTip) fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGButton::HandleCrossing(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:357:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Reset(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:359:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual void TGButton::SetToolTipText(const char*, Long_t)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:397:14: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete] delete fTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:397:14: warning: invalid use of incomplete type ‘class TGToolTip’ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: warning: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:397:14: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined delete fTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:402:74: error: invalid use of incomplete type ‘class TGToolTip’ fTip = new TGToolTip(fClient->GetDefaultRoot(), this, text, delayms); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGTextButton::HandleKey(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:775:48: error: invalid use of incomplete type ‘class TGToolTip’ if (fTip && event->fType == kGKeyPress) fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGCheckButton::HandleButton(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1283:18: error: invalid use of incomplete type ‘class TGToolTip’ if (fTip) fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGCheckButton::HandleCrossing(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1327:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Reset(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1329:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGCheckButton::HandleKey(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1361:48: error: invalid use of incomplete type ‘class TGToolTip’ if (fTip && event->fType == kGKeyPress) fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGRadioButton::HandleButton(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1648:18: error: invalid use of incomplete type ‘class TGToolTip’ if (fTip) fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGRadioButton::HandleCrossing(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1696:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Reset(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1698:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGRadioButton::HandleKey(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1729:11: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual void TGButton::SavePrimitive(std::ostream&, Option_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:1850:29: error: invalid use of incomplete type ‘class TGToolTip’ TString tiptext = fTip->GetText()->GetString(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘Bool_t TGSplitButton::HandleSCrossing(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:2435:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Reset(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:2437:14: error: invalid use of incomplete type ‘class TGToolTip’ fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘Bool_t TGSplitButton::HandleSKey(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:2485:48: error: invalid use of incomplete type ‘class TGToolTip’ if (fTip && event->fType == kGKeyPress) fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual void TGSplitButton::SetText(TGHotString*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:2744:24: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete] if (fTip) delete fTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:2744:24: warning: invalid use of incomplete type ‘class TGToolTip’ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: warning: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx:2744:24: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined if (fTip) delete fTip; ^ /home/ja/.root6/root/gui/gui/src/TGButton.cxx: In member function ‘virtual Bool_t TGSplitButton::HandleKey(Event_t*)’: /home/ja/.root6/root/gui/gui/src/TGButton.cxx:2986:48: error: invalid use of incomplete type ‘class TGToolTip’ if (fTip && event->fType == kGKeyPress) fTip->Hide(); ^ In file included from /home/ja/.root6/root/gui/gui/src/TGButton.cxx:91:0: include/TGButton.h:67:7: error: forward declaration of ‘class TGToolTip’ class TGToolTip; ^ make: *** [gui/gui/src/TGButton.o] Error 1

What should I do to be able to use root 6 on my Ubuntu machine?
I am using g++ 4.9.2.

I look forward to hearing from you.

Are you sure you are using gcc 4.9.2? The default compiler in ubuntu 12.04 is gcc 4.6.3 and this one cannot be used since it does not support c++11.
Please use the the CMake build. root.cern.ch/building-root