Results 1 to 18 of 18

Thread: How to find GCC 4.7 compiler package?

  1. #1
    Join Date
    2016-Nov
    Posts
    23

    How to find GCC 4.7 compiler package?

    Hi!
    I'm on Kali Linux 2016.2 live USB system, and I'll need to replace my actual GCC compiler(version 5.4) with another one in version 4.7.....On the Kali repositories the oldest versions available is gcc 4.9.
    Any ideas on how to get installed the GCC version 4.7 on my system, despite the fact that it's not available on official Kali repository?

  2. #2
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    1,012
    My current gcc version is 6.2.1 last released on 24/11/2016. gcc is automatically updated with apt-get upgrade and apt-get dist-upgrade.
    To find your gcc version enter gcc --version.

  3. #3
    Join Date
    2016-Nov
    Posts
    23
    Quote Originally Posted by _defalt View Post
    My current gcc version is 6.2.1 last released on 24/11/2016. gcc is automatically updated with apt-get upgrade and apt-get dist-upgrade.
    To find your gcc version enter gcc --version.
    I already know that....I have gcc 5.4 version....And I'll need gcc 4.7 to replace the one I have now.... I've tried(don't know if it's right or not) to add debian repository and install the gcc 4.7 package from this source, but the installation didn't start because of some dependencies relations.
    Now I really don't know how to do.

  4. #4
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    1,012
    It's obvious. Old packages don't follow new dependencies. Dependencies are actually upgraded first to upgrade packages else they refuse to install.

  5. #5
    Join Date
    2016-Nov
    Posts
    23
    So there's no way to get gcc 4.7 installed....Maybe if I take an old Kali ISO.....
    Old enough to have GCC 4.7 as default compiler....Is this possible? And in case, do you know which is?

  6. #6
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    1,012
    Any reason to use outdated version of gcc? Download old gcc package. It will be a zip folder with all libraries included. You don't have to install it. Then change the path to that folder.

  7. #7
    Join Date
    2016-Nov
    Posts
    23
    Almost forgot thank you for the help first of all.
    Actually yes....In a few word: I've installed proprietary Nvidia driver, and since my GPU is an old 330m (from 2010) It uses old driver version too as well as the CUDA toolkit...Now all this stuff seems to not support my default gcc compiler(5.4 version) and searching on the web I've found that the gcc 4.7 fits best my configuration(I've tried even 4.9 which is the oldest version available on Kali repositories but nothing)....So here's where the problem come from.
    About the path I should create for letting gcc works....Can you explain me how to do that?
    I've already downloaded the gcc 4.7 .deb archive
    Last edited by itanon; 2017-01-28 at 15:24.

  8. #8
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    1,012
    This may help: https://superuser.com/questions/4881...-path-on-linux
    The file where environment variables are stored is located in /etc/bash.bashrc. Take its backup before you mess up with it.

  9. #9
    Join Date
    2016-Nov
    Posts
    23
    OK thanks for all your support!

  10. #10
    Join Date
    2016-Nov
    Posts
    23
    Hey sorry for the insistence but I'm a bit confused and in that link I've found nothing, except for the page I've linked down here....Honestly I didn't realize what I have to do for change the path to the gcc 4.7 folder.
    From this link:
    https://help.ubuntu.com/community/EnvironmentVariables
    I've found that GCC environment variables is called cc
    Exactly what I have to do for changing path to the folder?
    I get that bashrc files is where this change has to be performed, but then what are the commands to issue for that?

  11. #11
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    1,012
    export PATH=$PATH:/your/new/path/here

  12. #12
    Join Date
    2016-Nov
    Posts
    23
    Ok so,
    1)since the gcc 4.7 archive is in downloads my command will be
    "export PATH=$PATH:/Downloads/" ?
    2)I know that, in case of adding a new compiler, it should be updated the list of available compiler with the
    "update-alternatives etc..." Command.
    So it is in this case?

  13. #13
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    1,012
    Right click on gcc 4.7 application and open its properties. The exact directory is given there. Copy that directory in that command.

  14. #14
    Join Date
    2016-Nov
    Posts
    23
    So my gcc 4.7 archive was located at /inode/directory so I entered the bash file with:
    nano ~./ bashrc
    Then I issued
    export PATH=PATH$:/inode/directory
    Saved and exit
    But nothing seems to be changed, besides that, the command "gcc --version" gave me that I'm using the original version of gcc compiler, that is 5.4 and not the 4.7 .....So I think the path command didn't change the question.
    Thanks for all your support anyway _defalt but I think to quit this thread due to unsolved problem

  15. #15
    Join Date
    2016-Oct
    Location
    /dev/sda
    Posts
    1,012
    I think you are addding wrong path. You said you downloaded the zip file and you must have extracted it in the download folder. So the directory of gcc 4.7 must be /home/downloads/gcc folder. Your command should look like this export PATH=$PATH:/home/downloads/gcc folder. You can confirm this directory by simply looking in the titlebar or by clickling the properties of any file inside the gcc folder.

  16. #16
    Join Date
    2016-Nov
    Posts
    23
    You were right....Now I've issued the right path:
    export PATH=$PATH:/Home/Dowoads/gcc-4.7
    Saved the bashrc file.
    Again, the command gcc --version gives me that I'm using the gcc 5.4 compiler....Not the 4.7
    Now is sure that the path variable command isn't working, isn't it?

  17. #17
    hello change .h file in error to accept gcc 5.4

  18. #18
    Join Date
    2016-Nov
    Posts
    23
    Quote Originally Posted by hausoo View Post
    hello change .h file in error to accept gcc 5.4
    I can't get what you mean....What should I do?

Similar Threads

  1. Replies: 7
    Last Post: 2016-01-02, 12:15
  2. Can not find GRUB package on LiveUSB.
    By Altmer in forum Installing Archive
    Replies: 0
    Last Post: 2013-10-31, 17:04

Posting Permissions

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