【问题标题】:configure error: C compiler cannot create executables配置错误:C 编译器无法创建可执行文件
【发布时间】:2013-09-24 12:34:42
【问题描述】:

我试图安装 rvm ( \curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles)。在 ZI 出现配置错误之前它运行良好:

Error running './configure --prefix=/home/nishant/.rvm/rubies/ruby-2.0.0-p247 --disable-install-doc --enable-shared',
please read /home/nishant/.rvm/log/1379591052_ruby-2.0.0-p247/configure.log
There has been an error while running configure. Halting the installation.

以下是上述日志文件的内容:

[2013-09-19 17:15:58] ./configure
current path: /home/nishant/.rvm/src/ruby-2.0.0-p247
command(4): ./configure --prefix=/home/nishant/.rvm/rubies/ruby-2.0.0-p247 --disable-install-doc --enable-shared
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/nishant/.rvm/src/ruby-2.0.0-p247':
configure: error: C compiler cannot create executables
See `config.log' for more details

然后我尝试了一个“hello world”C程序,编译时出现以下错误:

nishant@nishant-Inspiron-1545:~$ gcc -g -o hello hello.c 
/usr/local/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status

我不确定为什么会引发此错误。我在论坛上找不到满意的答案。有人可以帮忙吗。 谢谢

【问题讨论】:

    标签: ubuntu gcc linker gcc4.7


    【解决方案1】:

    我遇到了同样的问题,我解决了购买安装证书和库以构建 C 程序

    apt-get install build-essential
    

    【讨论】:

      猜你喜欢
      • 2012-05-08
      • 1970-01-01
      • 2021-04-23
      • 2019-02-03
      • 1970-01-01
      • 2020-01-21
      • 2018-08-02
      • 2014-04-12
      • 2018-06-08
      相关资源
      最近更新 更多