How to change the GCC version - linux

I just install a kali-linux, and trying to play with it.
I did use ubuntu before. That cause some problems with different gcc version when I am trying to use some code what I build in my old Ubuntu.
I check the gcc -v; the kali give me
gcc version 6.1.1 20160802(Debian 6.1.1-11)
and ubuntu give me
gcc version 5.4.0 20160609 (ubuntu 5.4.0-6ubuntu1~16.04.2)
I am not sure if my code doesn't compile because of this or not. But just want to check.
how can I remove Debian's gcc and switch to ubuntu one?

May be i'm not much familiar with debian. But with Ubuntu, i've followed this and changed the gcc version. May be this will help.
Change default gcc version
You can use this command to install gcc versions.
sudo apt-get install gcc-4.3 gcc-4.4
Once installed, you have to update the alternatives with the variant gcc versions. Using
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 10
You can choose which version of gcc, you can use by this command.
sudo update-alternatives --config gcc

Related

How to remove gcc 7.3 from RHEL 7?

RHEL 7 comes with built-in gcc of version 4.8.
If I do
yum remove gcc
then it removes gcc 4.8. How can I remove gcc 7.3 from the system completely?
I have tried to find the solution for the above problem but most of the solution is for Ubuntu. Can someone help to figure out a solution for CentOS/RHEL?
Thanks.
Note:
which gcc
/usr/local/bin/gcc
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=c,c++
Thread model: posix
gcc version 7.3.0 (GCC)
Try to give version number in package name to yum:
yum remove gcc-7.3.0

objdump is missing from windows10 pro (msys2 installed)

I have installed msys2 using chocolatey.
I have tried msys2-installer module from chocolatey too.
But I can not find objdump on my system. Should I install something more ?
MSYS2 supports three different compiler toolchains, all with their own objdump utility. I'm not sure which one you want to use, but you can just install them all by running:
sudo pacman -S binutils mingw-w64-x86_64-binutils mingw-w64-i686-binutils

Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler

I'm running Ubuntu 16.10 in my laptop;
I have recently downloaded Linux kernel from git, but when I am trying to compile it with a make command from the terminal.
It is giving me
"error:Cannot use CONFIG_CC_STACKPROTECTOR_STRONG:
-fstack-protector-strong not supported by compiler"
What should I do to resolve this problem?
See this thread and this answer: this error could be the result of multiple gcc versions alternatives.
See "What exactly does update-alternatives do?"
Clear them out:
$ sudo update-alternatives --remove-all gcc
$ sudo update-alternatives --remove-all g++
Then re-install them, and make sure your gcc and g++ reference the same version.
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
Note (March 2017): doug65536 mentions in the comments another case:
I found a solution to the issue with my nvidia driver package.
I had installed a custom build of binutils for a gdb patch.
Forcing it to reinstall binutils resolved the issue. It makes no sense, but it worked.

How to change the default compiler of Linux Mint 18.0 from version 5.3.1 to a version below 4.0?

I need to compile a special program (i.e. configuring, making, and making install processes of nest) by an old version of g++ such as 3.3 or 3.4. However, I don't have such versions in my package manager.
I downloaded g++-3.0-3.0.4-7_alpha-deb, but I don't know if it is the true version for Linux, or how can I install it and set as the default compiler. I will appreciate if any one informs me of its possible dangers to my Linux (as I read in Google).
First : You can have as many versions of gcc, g++ as you want, installed at the same time.
The default Mint 18, Ubuntu 16.04 versions are :
sudo apt install g++ g++-4.7 g++-4.8 g++-4.9
The reliable gcc, g++ version 3.4.6 : compat-gcc34-3.4.6-ubuntu1204-1_amd64.deb
https://drive.google.com/file/d/0B7S255p3kFXNRTkzQnRSNXZ6UVU/view?usp=sharing
, and compat-gcc-34-c++_3.4.6-20_amd64.deb https://drive.google.com/file/d/0B7S255p3kFXNV3J3bnVoWGNWdG8/view?usp=sharing
Please install with sudo dpkg -i compat-gcc*
Using, examples : 1) export CC=gcc34 CXX=g++34 && [other command] , like 2) export CC=gcc34 CXX=g++34 && ./configure ... and 3) make CC=gcc34 CXX=g++34

gcc available, but not installed in fedora

I installed gcc using sudo yum install gcc then I try compile c program it say gcc command not found then I try to update the gcc using sudo yum update gcc then it say Page(s) gcc available, but not installed I try to find an answer in google, but I'm unable to fined the solution. please can anyone help me ?
These steps might help check what the cause could be.
rpm -q gcc --> check if gcc is installed and managed by yum/rpm
which gcc --> check if gcc is in your search path for executables
gcc --version --> check if gcc works in the simplest way (perhaps the error came from incorrect source file path passed to it)
Finally I found the answer, first I did yum update audit then I install gcc using yum install gcc it works fine, thank you for your help

Resources