configure: error: C compiler cannot create executables

Written by
Date: 2007-11-11 10:36:30 00:00


Today I have tried to compile a software in a Debian Linux machine, when I run

./configure

I got

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for multicast... checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Then I installed gcc with:

apt-get install gcc

and try again, this time I got:

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for multicast... checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

To solve this I had to install g++

apt-get install g++

And then when I tried again it worked, so to compile software with Linux it seems that you mostly need to install both

gcc and g++

Update: Thanks to Thadeu Penna a friend of the blog for this tip.

using

apt-get install build-essential

Will install all the basic tools for developing in Debian and I know it also works for Ubuntu.