Saturday, May 11, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 11457  / 2 Years ago, fri, september 2, 2022, 1:35:52

In my Ubuntu there is g++ --version -



g++ (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


I want to have same g++ --version on another Linux machine which has -



g++ (GCC) 4.1.2 20070626 (Red Hat 4.1.2-14)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


How can I alter my g++ version to be the same as the above?


More From » installation

 Answers
6

Download the g++-4.1 version from here. g++-4.1 is not available in the recent Ubuntu repositories. So you need to download the package from the link provided.



Install/compile the download package alongside with the current version of g++.



Then use update-alternatives to switch version



sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.3 10


Change the default version by choosing the appropriate version:



sudo update-alternatives --config g++

[#34534] Friday, September 2, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ingssex

Total Points: 21
Total Questions: 122
Total Answers: 98

Location: Sweden
Member since Fri, Mar 26, 2021
3 Years ago
ingssex questions
;