Tag Archives: Linux (Ubuntu) system

configure: error: C compiler cannot create executables

An error message appears when executing ./configure :

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/jiajia/libuuid-1.0.3/libuuid-1.0.3':
configure: error: C compiler cannot create executables
See `config.log' for more details

I wonder. I’ve looked up a lot of information and summarized it:

Case 1: the export operation changes the values of cflags and LIBS
solution: clear the values of cflags and LIBS

export LIBS=
export CFLAGS=

Case 2: environment variable is modified

vi  ~/.bashrc

Check whether there is similar information at the end:

export CC=arm-linux-gcc
export AR=arm-linux-ar
export LD=arm-linux-ld
export RANLIB=arm-linux-ranlib
export STRIP=arm-linux-strip

Solution: delete or comment out the above information

Case 3: the GCC compilation environment is not configured properly
to solve the problem:

sudo apt-get install gcc libc6-dev

However, none of the above is my case, and the above operations are useless
Case 4: there is a problem with the software package, and the list information of the necessary software packages for the compiler cannot be provided
solution: reinstall the build essential software package

sudo apt purge binutils
sudo apt remove make
sudo apt autoremove
sudo apt install build-essential

The problem was finally solved and ./configure was successfully executed