I am writing to ask about how to choose the version of gcc during compiling. In my machine, I believe there are several version of gcc installed. Because the command 'gcc -v' returns 'gcc version 6.4.0 (GCC)', while command 'cc' returns 'gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)'. I know the 'cc' is actually linked to the gcc compiler. And in the makefile, 'CC ?= gcc' should be the command to link cc to gcc.
Thus, is that means the gcc 4.4.7 is always be used when I compiling? Please, how should I change the cc or the makefile to make it link to the newer gcc version? btw, I don't have the permission to use 'sudo' command.
edit: Thanks for your replying. The output of type -a cc is 'cc is /usr/bin/cc' and another output is 'gcc is /util/bin/gcc gcc is /usr/bin/gcc' The upper path is the gcc 6.4 and the lower one is older version.
type -a cc
andtype -a gcc
.