LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-13-2012, 03:14 AM   #1
esgol
Member
 
Registered: Jul 2012
Posts: 106
Blog Entries: 1

Rep: Reputation: Disabled
How can I switch between g++ 4.5 4.6 4.7 versions in Debian Squeeze? (6.0.5)


Debian comes with 4 preinstalled version of g++ from 4.4 to 4.7.

What do I have to do to choose which version of g++ will be the default compiler in console when i
?g++ -std=gnu++0x -lpthread code.cpp -o ExeFile

Quote:
P.S. for Moderators
1.Until when Im allowed to use this newbie forum? post 50 maybe?

2.As you may have noticed, I start different threads even when a new question diverges just a bit from the thread title I've strated even if its still the same topic.
I do this for SEO purposes of the forum and think its the desired way also. If not you may inform.

Last edited by esgol; 07-13-2012 at 03:17 AM.
 
Old 07-13-2012, 03:58 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Examples using the non default compilers
( default = /usr/bin/ gcc g++ ) :

1. gcc-4.4 hello.c -o hello

2. export CC=gcc-4.4 CXX=g++-4.4 && <other-command>,
like : export CC=gcc-4.4 CXX=g++-4.4 && ./configure && make

3. CC=gcc-4.4 CXX=g++-4.4 cmake ../


Also : The default compiler can be changed :
# update-alternatives --config gcc
.... If you then choose e.g. version 4.7, the links in /usr/bin/
will be set to point to gcc-4.7 / g++-4.7 .


.

Last edited by knudfl; 07-13-2012 at 04:08 AM.
 
1 members found this post helpful.
Old 07-13-2012, 04:35 AM   #3
esgol
Member
 
Registered: Jul 2012
Posts: 106
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
so simple as i immagined. I also had cought somewhere thatupdate alternatives command and was supposing it would have something to do. thank you
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to add Debian Squeeze to your Debian Lenny FAI install server LXer Syndicated Linux News 0 09-08-2011 08:21 PM
Various segmentation faults Debian Squeeze Virtualbox running on Debian Squeeze host fordwrench Debian 1 07-21-2011 04:55 AM
Should I switch to apt-get after upgrading to Squeeze? Deerslayer Debian 7 05-01-2011 02:37 AM
LXer: How To Upgrade Debian Lenny (Debian 5.0) To Squeeze (Debian 6.0) On Xen VPS LXer Syndicated Linux News 0 03-09-2011 06:20 AM
How to switch java versions... markw8500 Programming 3 09-24-2006 07:54 PM


All times are GMT -5. The time now is 06:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration