configure: error: C compiler cannot create executables

最近搞坏了ubuntu,大半夜装好公司的电脑-limint系统,第二天早晨编译 ./configure出错configure: error: C compiler cannot create executables

很是无语呀,找了很多解决办法:

1,

Having a compiler (like gcc) is not enough to compile C programs, you also need a C library. If it is missing, you will experience the (somewhat obscure) error message:

configure: error: C compiler cannot create executables

You may fix this by installing libc6-dev and linux-libc-dev packages. After you install them, simply rerun ./configure.

没有效果!

2,

You can test this by compiling a small C example with the -m32 flag.

// Minimal C example
#include <stdio.h>
int main()
{
   printf("This works\n");
   return 0;
}

Compiling:

gcc -m32 -o m32test m32test.c
确实也没有通过!

3,

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
这是解释:ask:it would be interesting to know why GCC didn't work
answer:GCC doesn't work for me either. Clang works though.
这个方法好使!
另外还有一个方法没有试试:
ln -s /usr/bin/gcc /usr/bin/gcc-apple-4.2

 

转载于:https://www.cnblogs.com/codeblock/p/4729711.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值