View Full Version : 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?
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.
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.
It's obvious. Old packages don't follow new dependencies. Dependencies are actually upgraded first to upgrade packages else they refuse to install.
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?
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.
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
This may help: https://superuser.com/questions/488173/how-can-i-edit-the-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.
OK thanks for all your support!
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?
export PATH=$PATH:/your/new/path/here
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?
Right click on gcc 4.7 application and open its properties. The exact directory is given there. Copy that directory in that command.
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
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.
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?
hello change .h file in error to accept gcc 5.4
hello change .h file in error to accept gcc 5.4
I can't get what you mean....What should I do?