How to change gcc version linux

吃可爱长大的小学妹 提交于 2019-12-12 06:39:24

问题


I have gcc-4.6 & gcc-4.7 both installed on my machine and I made gcc the default compiler. But still I could see 4.6 under "cat /proc/version" but I want 4.7 in place of 4.6.

cat /proc/version 
Linux version 3.2.0-4-rt-686-pae (debian-kernel@lists.debian.org) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP PREEMPT RT Debian 3.2.65-1+deb7u2

How can I change gcc version here from 4.6 to 4.7 ?

Any help would be really helpfull for me.

Many Thanks.


回答1:


As the same problem is mentioned here https://askubuntu.com/questions/193539/having-2-versions-of-gcc I suggest you to check the solution.




回答2:


This is because you have both versions installed,and 4.6 being treated as the default. The easiest way make gcc-4.7 the default gcc is to move the symlink of /usr/bin/gcc:

sudo rm /usr/bin/gcc

sudo ln -s /usr/bin/gcc-4.7 /usr/bin/gcc

Reference link here




回答3:


Is there any way to use a module in 3.2 which is compiled with kernel 3.10 ?

You can try the option -f of modprobe.



来源:https://stackoverflow.com/questions/29144241/how-to-change-gcc-version-linux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!