Cannot install driver : check that 'cc' is in your PATH

Hello, I want to install TITAN RTX driver on Ubuntu 16.04 LTS(should maintenance this version).

I did like this:
cosmos@cosmos-System-Product-Name:~$ sudo sh NVIDIA-Linux-x86_64-418.74.run
Verifying archive integrity… OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86_64 418.74…

But installer said this :
ERROR: Unable to find the development tool cc in your path; please make sure that you have the package ‘gcc’ installed. If
gcc is installed on your system, then please check that cc is in your PATH.

So I checked gcc version:
cosmos@cosmos-System-Product-Name:~$ gcc --version
gcc-5 (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright © 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

how can I solve this problem? I tried many versions : 418.74, 440.100, 450.71. but they occurred same error. Thank you.

your gcc might not complete with the development files…
try to follow this installation note : https://linuxize.com/post/how-to-install-gcc-compiler-on-ubuntu-18-04/

you might also wanna use the “–no-cc-version-check” option to skip the cc versioning check by the nvidia installer.