error: C compiler cannot create executables [How to Solve]

Phenomenon:

./configure --prefix=/usr/local/python3.6
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.6... no
checking for python3... no
checking for python... python
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... linux
checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/Python-3.6.13':
configure: error: C compiler cannot create executables
See `config.log' for more details

Solution:

1. View log

# cat config.log |grep error
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/cc1: error while loading shared libraries: libmpfr.so.4: cannot open shared object file: No such file or directory
configure:4005: error: in `/tmp/Python-3.6.13':
configure:4007: error: C compiler cannot create executables

Missing libmpfr.so.4 File

2. Install mpfr

Package name:mpfr-3.1.1-4.el7.x86_64

~# yum install mpfr-3.1.1-4.el7.x86_64 -y
......
Verification:
~# ll /usr/lib64/libmpfr.so.4
libmpfr.so.4      libmpfr.so.4.1.1  
~# ll /usr/lib64/libmpfr.so.4
lrwxrwxrwx 1 root root 16 Sep  7 22:26 /usr/lib64/libmpfr.so.4 -> libmpfr.so.4.1.1

Finally, the problem is solved

Read More: