Search code examples
c++11g++codelite

Pointing CodeLite to new compiler (GCC 4.8.x)


I am running CodeLite 5.2 on Ubuntu 12.04 LTS (downgraded from 13.04, which has some stability problems right now).

I just installed the GCC 4.8 compiler, which is not the default GCC compiler on 12.04. I need this compiler to get all the C++ 11 features it supports and were there by default with the compiler that comes with 13.04, using the ‘-std=c++11' switch.

So now I have 4.8 compiler installed, but I can't figure out how to tell CodeLite to use that compiler instead of the default GCC compiler that comes with 12.04 (4.4.x?). How do I do this?


Solution

  • From our Linux guru in the office:

    These commands should be run as the superuser (sudo):

    apt-get install g++-4.8.1
    
    update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 100
    
    update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8.1 50
    
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 100
    
    update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8.1 50
    
    update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.6 100
    
    update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.8.1 50
    
    update-alternatives --set g++ /usr/bin/g++-4.8.1
    
    update-alternatives --set gcc /usr/bin/gcc-4.8.1
    
    update-alternatives --set cpp-bin /usr/bin/cpp-4.8.1