编译软件问题configure: error: C compiler cannot create executables

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
tongtongmay
帖子: 7
注册时间: 2008-09-26 1:11
来自: Singapore

编译软件问题configure: error: C compiler cannot create executables

#1

帖子 tongtongmay » 2008-10-03 20:46

在安装tar.gz或者tar.bz2的时候编译出现这样的错误:

代码: 全选

configure: error: C compiler cannot create executables
See `config.log' for more details.
之后google看到有人说是要安装gcc,就查了一下新立得,发现里面有各种各样的gcc若干个,有的已经装了,有的没装。不敢贸然行事。
后来又google,看有人说要装build-essential,于是就

代码: 全选

sudo apt-get install build-essential 
但是出现这个:

代码: 全选

正在读取软件包列表... 完成
正在分析软件包的依赖关系树
读取状态信息... 完成
有一些软件包无法被安装。如果您用的是不稳定(unstable)发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们还在新到(incoming)目录中。

您仅要求对单一软件包进行操作,这极有可能是因为该软件包安装不上,同时,
您最好提交一个针对这个软件包的故障报告。
下列的信息可能会对解决问题有所帮助:

下列的软件包有不能满足的依赖关系:
  build-essential: 依赖: libc6-dev 但是它将不会被安装 或
                           libc-dev
                   依赖: g++ (>= 4:4.1.1) 但是它将不会被安装
                   依赖: dpkg-dev (>= 1.13.5) 但是它将不会被安装
E: 无法安装的软件包
不知是出现什么问题,希望能人给解答,最好告知原因。谢谢!
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

Re: 编译软件问题configure: error: C compiler cannot create executables

#2

帖子 BigSnake.NET » 2008-10-03 20:47

源没设对,估计是版本不对应
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
dmg
帖子: 267
注册时间: 2008-09-13 11:08

Re: 编译软件问题configure: error: C compiler cannot create executables

#3

帖子 dmg » 2008-10-03 20:49

用新力得安装吧,因为在终端上安装是不会帮你自己下载安装依赖的。
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

Re: 编译软件问题configure: error: C compiler cannot create executables

#4

帖子 BigSnake.NET » 2008-10-03 20:52

dmg 写了:用新力得安装吧,因为在终端上安装是不会帮你自己下载安装依赖的。
胡说..
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
delectate
帖子: 18311
注册时间: 2008-01-09 22:41

Re: 编译软件问题configure: error: C compiler cannot create executables

#5

帖子 delectate » 2008-10-03 20:54

BigSnake.NET 写了:
dmg 写了:用新力得安装吧,因为在终端上安装是不会帮你自己下载安装依赖的。
胡说..
估计是源或者u版本问题

lz的情况貌似只要这个就可以了

sudo apt-get install libc6-dev

不行就要gcc
头像
kukunya
帖子: 241
注册时间: 2008-04-23 12:38
来自: Hefei P.R.C.

Re: 编译软件问题configure: error: C compiler cannot create executables

#6

帖子 kukunya » 2008-10-03 20:54

感觉应该换个源,要不是8.10的源 :em23 :em24 问题?
爱自由,爱生活
--
Intel Core 2 Duo T6670
Intel GMA X4500 HD
Samsung DDR3 2G
WD 320G
--
U-Studio Karmic
头像
dmg
帖子: 267
注册时间: 2008-09-13 11:08

Re: 编译软件问题configure: error: C compiler cannot create executables

#7

帖子 dmg » 2008-10-03 20:55

哦,不好意思。
学习!
头像
dmg
帖子: 267
注册时间: 2008-09-13 11:08

Re: 编译软件问题configure: error: C compiler cannot create executables

#8

帖子 dmg » 2008-10-03 20:57

BigSnake.NET 写了:
dmg 写了:用新力得安装吧,因为在终端上安装是不会帮你自己下载安装依赖的。
胡说..

那apt-get 是否可以自动下载包进行安装呢?
头像
kukunya
帖子: 241
注册时间: 2008-04-23 12:38
来自: Hefei P.R.C.

Re: 编译软件问题configure: error: C compiler cannot create executables

#9

帖子 kukunya » 2008-10-03 21:03

dmg 写了:
BigSnake.NET 写了:
dmg 写了:用新力得安装吧,因为在终端上安装是不会帮你自己下载安装依赖的。
胡说..

那apt-get 是否可以自动下载包进行安装呢?
这两个是一回事吧?
爱自由,爱生活
--
Intel Core 2 Duo T6670
Intel GMA X4500 HD
Samsung DDR3 2G
WD 320G
--
U-Studio Karmic
tongtongmay
帖子: 7
注册时间: 2008-09-26 1:11
来自: Singapore

Re: 编译软件问题configure: error: C compiler cannot create executables

#10

帖子 tongtongmay » 2008-10-03 22:07

谢谢各位!
1 我刚试了后代朋友的提议安装sudo apt-get install libc6-dev,可是还是有问题,出现这个:

代码: 全选

./configure --prefix=/usr
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 a BSD-compatible install... /usr/bin/install -c
checking for -p flag to install... yes
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for kde-config... /usr/bin/kde-config
checking where to install... /usr (as requested)
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking whether gcc is blacklisted... no
checking whether g++ supports -Wmissing-format-attribute... no
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether g++ supports -Wundef... no
checking whether g++ supports -Wno-long-long... no
checking whether g++ supports -Wno-non-virtual-dtor... no
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
2 关于源的问题,我现在用的是我们学校提供的源http://opensource.nus.edu.sg/wiki/index.php/Ubuntu_Linux,我刚刚看,好像上面没有写是否适合我用的ubuntu的版本(8.04),所以我换了速配指南里推荐的一个。可是结果还是一样。似乎这个问题和源没有关系。
3 我google了configure: error: C compiler cannot create executables这个问题,发现英文论坛上有类似的提问,似乎还是和gcc有关系。
4 我现在想知道,新立得里有跟gcc有关的软件包有29个,我目前安装了3个,其他的哪些是编译软件所必须的?
我已经安装的有gcc; gcc-4.2; gcc-4.2-base
谢谢!
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

Re: 编译软件问题configure: error: C compiler cannot create executables

#11

帖子 xhy » 2008-10-03 23:35


一次用错
终身受害
目前负债150多万
回复