Recently ruined Ubuntu, the big night installed the company's computer-limint system, the next morning to compile./configure error CONFIGURE:ERROR:C compiler cannot create executables
It is no language ah, find a lot of solutions:
1,
Have a compiler (like GCC) are not enough to compile C programs, you also need a C library. If It is missing, you'll experience the (somewhat obscure) error message:
Configure:error:c compiler cannot create executables
You could fix this by installinglibc6-devandlinux-libc-devpackages. After you install them, simply rerun./configure.
No effect!
2,
You can test this by compiling a small C example with the-m32flag.
// Minimal C example#include <stdio.h>int main(){ printf("This works\n"); return 0;}
Compiling:
gcc -m32 -o m32test m32test.c
It did not pass!
Logs don ' t lie! Configure.log is what I need to get to the root of the problem. The issue is this:
GCC checking whether the C compiler works ... no
The simple answer to this is just
sudo apt-get install clang && rvm install 1.9.3 --with-gcc=clang
This is the explanation: ask:it would be interesting to know why GCC didn’t work
Answer:GCC doesn't work for me either. Clang works though.
This method Work! There is another way not to try it:
ln -s /usr/bin/gcc /usr/bin/gcc-apple-4.2
Configure:error:c compiler cannot create executables