Page 1 of 2
Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Sun Jul 28, 2013 1:55 pm
by mikey
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?
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Sun Jul 28, 2013 2:04 pm
by eranif
I think that the prefered way is to use update-alternative to point to the version of the compiler that you want
You can also go to :Settings -> Build Settings -> Compiler and replace the various 'gcc' / 'g++' entries with a full path to your compiler
Eran
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Mon Jul 29, 2013 12:34 am
by Gibbon1
I have two suggestions from the peanut gallery.
About the build setting panel that would make it a lot easier to use.
1. Add a field for the path to the compilers bin folder.
2. Add a copy feature so you can copy a compiler setting.
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Mon Jul 29, 2013 12:39 pm
by mikey
I will try doing it in codelite too but it seems that as Efran mentioned, you can do that kind of thing with update-alternative - which tells the whole system to use that compiler as the default GCC compiler. Not sure of the syntax I need though.
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Mon Jul 29, 2013 12:41 pm
by mikey
Eran - update-alternative - do you know syntax for getting to change default of GCC? I put a question on AskUbuntu but that site isn't very strong - no answers.
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Mon Jul 29, 2013 3:24 pm
by DavidGH
Hi,
I had a quick look at the update-alternatives man page.
See what's available with:
update-alternatives --display c++
Select one with:
update-alternatives --config c++
entering your preferred selection when asked.
Regards,
David
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Mon Jul 29, 2013 8:06 pm
by mikey
Thanks - will check it out. Still new to Linux - have to start making a habit of looking at man pages.
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Tue Jul 30, 2013 7:41 pm
by mikey
update-alternatives --config c++ told me there are no alternatives available for the GCC stuff that's in there. I reinstalled everything with Synaptic - the packages are there. There is more that needs to be done.
Check this if it interests you:
Choose gcc and g++ version
http://askubuntu.com/questions/26498/ch ... -g-version
- I have to go through it again to make sure I know that it's doing - afraid I'll break everything.
Thanks
M
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Wed Jul 31, 2013 11:19 am
by DavidGH
Are you sure you want to do this? It would be probably be easier, and certainly safer, just to use the full path to your chosen g++ version inside CodeLite.
If you
do want a global change, and update-alternatives isn't co-operating, what I'd do is simply to use a file manager (I use, ahem,
4Pane) to change the destinations of the symlinks /usr/bin/g++ and /usr/bin/gcc.
(Yes, that means running a file manager with superuser privileges, which some will advise against. But IMHO it's less dangerous for an inexperienced user to be superuser in a gui than from the command-line.)
Re: Pointing CodeLite to new compiler (GCC 4.8.x)
Posted: Wed Jul 31, 2013 12:38 pm
by mikey
It would be probably be easier, and certainly safer, just to use the full path to your chosen g++ version inside CodeLite.
That's probably what I'll do, once I figure out all the right paths. Synaptic is good for that.
Tnx