Find the answer to your Linux question:
Results 1 to 2 of 2
Hello community, I am using linux with gcc-4.7.2 and I need to compile a program specifically with another gcc version (4.4) Is there an easy way of installing this lower ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Posts
    6

    Using different gcc versions


    Hello community,
    I am using linux with gcc-4.7.2 and I need to compile a program specifically with another gcc version (4.4)
    Is there an easy way of installing this lower version and use it just to compile this program?

    Many thanks in advance!

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    586
    GCC allows for more than one version to be present on a system at one time. They include the "gcc-config" command to select which version that the user is using. Sometimes you package manager does not have the particular version that you are interested in. For instance my package manager allows you to install one version from each of these sets at the same time.
    • 3.4.6-r2
    • 4.1.2
    • 4.3.4
    • 4.4.4-r2 or 4.4.5 or 4.4.6-r1 or 4.4.7
    • 4.5.3-r2 or 4.5.4
    • 4.6.3

    I have installed versions 4.5.4 and 4.6.3.

    When I ask for profiles using gcc-config, I see:
    Code:
     [1] x86_64-pc-linux-gnu-4.5.4 *
     [2] x86_64-pc-linux-gnu-4.6.3
    Which means that when I use the default name (say g++) it will be using version 4.5.4. I can run a specific version via "g++-4.5.4" or "g++-4.6.3".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •