How to change the default GCC compiler in Ubuntu?

As @Tommy suggested, you should use update-alternatives It assigns values to every software of a family, so that it defines the order in which the applications will be called It is used to maintain different versions of the same software on a system. In your case, you will be able to use several declinations of gcc and one will be favoured To figure out the current priorities of gcc, type in the command pointed out by @tripleee's comment: update-alternatives --query gcc Now, note the priority attributed to gcc-4.4 because you'll need to give a higher one to gcc-3.3 To set your alternatives, you should have something like this (assuming you gcc installation is located at usr/bin/gcc-3.3 and gcc-4.4 s priority is less than 50) : update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.3 50 edit Finally, you can also use the interactive interface of update-alternatives to easily switch between versions. Type update-alternatives --config gcc to be asked to choose the gcc version you want to use among those installed edit 2 Now, to fix the CXX environment variable systemwide, you need to put the line indicated by @DipSwitch's in your bashrc file (this will apply the change only for your user, which is safer in my opinion): echo 'export CXX=/usr/bin/gcc-3.3' >> ~/.bashrc.

As @Tommy suggested, you should use update-alternatives. It assigns values to every software of a family, so that it defines the order in which the applications will be called. It is used to maintain different versions of the same software on a system.In your case, you will be able to use several declinations of gcc, and one will be favoured.

To figure out the current priorities of gcc, type in the command pointed out by @tripleee's comment: update-alternatives --query gcc Now, note the priority attributed to gcc-4.4 because you'll need to give a higher one to gcc-3.3. To set your alternatives, you should have something like this (assuming you gcc installation is located at /usr/bin/gcc-3.3, and gcc-4.4's priority is less than 50): update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-3.3 50 --edit-- Finally, you can also use the interactive interface of update-alternatives to easily switch between versions. Type update-alternatives --config gcc to be asked to choose the gcc version you want to use among those installed. --edit 2 -- Now, to fix the CXX environment variable systemwide, you need to put the line indicated by @DipSwitch's in your .

Bashrc file (this will apply the change only for your user, which is safer in my opinion): echo 'export CXX=/usr/bin/gcc-3.3' >> ~/.bashrc.

Thanks a lot jHackTheRipper – RoboAlex Oct 21 at 4:43.

I don't get any useful help from the link you suggested. I have already installed bots GCC. I just need to change the default gcc to gcc-3.3 – RoboAlex Oct 20 at 8:41 1 The command you want is sudo update-alternatives --query gcc – tripleee Oct 20 at 9:41 1 @RoboAlex: I updated my answer to take into account tripleee's suggestion – jHackTheRipper Oct 20 at 15:12.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions