Configure:error:c compiler cannot create executables

Source: Internet
Author: User



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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.