0

The gcc/g++ version in my personal Centos is 8.3.1 but in our company it is 5.3.1. I have a .a file compiled under g++ 8.3.1 which does not work on 5.3.1. Thus I wish to downgrade g++ in my personal computer to 5.3.1 as well. How can I do it? I tried to install it from source code but failed. Thanks!

S. Y
  • 173
  • 1
  • 1
  • 7
  • Generally speaking there's nothing to prevent you having multiple versions of the GNU toolchain installed on one system (provided the installations are kept separate). If you had problems installing from source you should edit your question to show what you tried and the specific problem(s) you encountered. – G.M. May 16 '20 at 10:54
  • The question belongs to SuperUser. [Installing a specific package version with yum](https://superuser.com/questions/330661/installing-a-specific-package-version-with-yum) – Kashinath Patekar May 16 '20 at 10:56
  • Thanks! I am trying to install g++-5.3.0. Will ask a new question later. – S. Y May 16 '20 at 10:59
  • Beside of this, you could try first to give your current compiler a different C++ standard than its default. E.g. `g++ -std=c++11` to exclude C++14 and C++17 features. I have no experience how well this works in general but I used it recently in my answer to [SO: C/C++: How to exit sleep() when an interrupt arrives?](https://stackoverflow.com/a/61496169/7478597) to sort out some detail issues for features which appeared with C++14 or C++17. – Scheff's Cat May 16 '20 at 11:06

0 Answers0