# Root compilation error on Ubuntu 12.04

**URL:** <https://root-forum.cern.ch/t/root-compilation-error-on-ubuntu-12-04/20669>\
**Category:** ROOT\
**Created:** [February 22, 2016, 9:19pm UTC](https://root-forum.cern.ch/t/root-compilation-error-on-ubuntu-12-04/20669 "2016-02-22T21:19:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adendek](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/e95f7d/32.png) [@adendek](https://root-forum.cern.ch/u/adendek)\
**Post date:** [February 22, 2016, 9:19pm UTC](https://root-forum.cern.ch/t/root-compilation-error-on-ubuntu-12-04/20669/1 "2016-02-22T21:19:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mato](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mato/32/12317_2.png) [@mato](https://root-forum.cern.ch/u/mato)\
**Post date:** [February 22, 2016, 9:46pm UTC](https://root-forum.cern.ch/t/root-compilation-error-on-ubuntu-12-04/20669/2 "2016-02-22T21:46:00Z")

</div>

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](https://root.cern.ch/building-root)
