Ubuntu使用gcc无法找到库文件(stdio.h sys/stat.h等等)

软件和网站开发以及相关技术探讨
felixyan
帖子: 6
注册时间: 2007-03-07 21:04

Ubuntu使用gcc无法找到库文件(stdio.h sys/stat.h等等)

#1

帖子 felixyan » 2007-03-07 21:15

Ubuntu使用gcc无法找到库文件(stdio.h sys/stat.h等等),是怎么回事?是没有安装glibc,还是其他什么原因?
总之现在用gcc无法编译任何.c 文件
头像
titainium
帖子: 689
注册时间: 2006-12-02 12:25

#2

帖子 titainium » 2007-03-08 11:47

装build-esstional先
Titainium
felixyan
帖子: 6
注册时间: 2007-03-07 21:04

Thank you! 头文件出来了!

#3

帖子 felixyan » 2007-03-08 14:19

Thank titainium. 安装了buil-esstional后,头文件出来了!
头像
titainium
帖子: 689
注册时间: 2006-12-02 12:25

#4

帖子 titainium » 2007-03-08 19:53

进新立得,把会用到的开发库都装上,不用嫌多,只要你的硬盘够大。这样你就不会少东西,呵呵。 :em08
Titainium
头像
weilichun
帖子: 218
注册时间: 2007-09-09 15:41
来自: Beijing
联系:

#5

帖子 weilichun » 2007-09-09 15:46

titainium 写了:进新立得,把会用到的开发库都装上,不用嫌多,只要你的硬盘够大。这样你就不会少东西,呵呵。 :em08
:oops: Well,How can I install build-essential?
eter
帖子: 4
注册时间: 2007-09-03 21:43

#6

帖子 eter » 2007-09-12 15:37

好像很多,可不可以精简一下!
头像
木天
帖子: 21
注册时间: 2007-12-02 17:52

#7

帖子 木天 » 2007-12-19 16:43

sudo apt-get install build-essential时

提示:

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

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

下列的软件包有不能满足的依赖关系:
build-essential: 依赖: libc6-dev 但是它将不会被安装 或
libc-dev
依赖: g++ (>= 4:4.0) 但是它将不会被安装
dpkg: Breaks: dpkg-dev (< 1.14.0) 但是 1.13.11ubuntu7 正要被安装
E: 无法安装的软件包

what should I do?
nwpu043793
帖子: 39
注册时间: 2007-11-01 14:27
来自: 西北工业大学

#8

帖子 nwpu043793 » 2007-12-19 17:44

安装g++后就可以编译了
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

#9

帖子 dbzhang800 » 2007-12-20 12:54

木天 写了:sudo apt-get install build-essential时

提示:

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

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

下列的软件包有不能满足的依赖关系:
build-essential: 依赖: libc6-dev 但是它将不会被安装 或
libc-dev
依赖: g++ (>= 4:4.0) 但是它将不会被安装
dpkg: Breaks: dpkg-dev (< 1.14.0) 但是 1.13.11ubuntu7 正要被安装
E: 无法安装的软件包

what should I do?
更新你的源先
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

#10

帖子 dbzhang800 » 2007-12-20 12:58

nwpu043793 写了:安装g++后就可以编译了
不要误导别人
free-of-linux
帖子: 221
注册时间: 2007-11-08 18:19

#11

帖子 free-of-linux » 2007-12-21 14:21

sudo apt-get install build-essentia
tjitty
帖子: 3
注册时间: 2008-03-26 15:34

#12

帖子 tjitty » 2008-03-27 16:29

求助:我编译helloworld.c时报错。。。
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$ ls
helloworld.c helloworld.c~
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$ ls -l
总用量 4
-rw------- 1 tjitty root 129 2008-03-27 16:27 helloworld.c
-rw------- 1 tjitty root 0 2008-03-27 15:20 helloworld.c~
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$ gcc helloworld.c
helloworld.c: 在函数 ‘main’ 中:
helloworld.c:5: 错误: stray ‘\226’ in program
helloworld.c:5: 错误: stray ‘\128’ in program
helloworld.c:5: 错误: stray ‘\156’ in program
helloworld.c:5: 错误: ‘hello’ 未声明 (在此函数内第一次使用)
helloworld.c:5: 错误: (即使在一个函数内多次出现,每个未声明的标识符在其
helloworld.c:5: 错误: 所在的函数内只报告一次。)
helloworld.c:5: 错误: 程序中有游离的 ‘\’
helloworld.c:5: 错误: ‘world’ 未声明 (在此函数内第一次使用)
helloworld.c:5: 错误: syntax error before ‘n’
helloworld.c:5: 错误: stray ‘\226’ in program
helloworld.c:5: 错误: stray ‘\128’ in program
helloworld.c:5: 错误: stray ‘\157’ in program
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

#13

帖子 dbzhang800 » 2008-03-27 16:57

求助:我编译helloworld.c时报错。。。
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$ ls
helloworld.c helloworld.c~
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$ ls -l
总用量 4
-rw------- 1 tjitty root 129 2008-03-27 16:27 helloworld.c
-rw------- 1 tjitty root 0 2008-03-27 15:20 helloworld.c~
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$ gcc helloworld.c
helloworld.c: 在函数 ‘main’ 中:
helloworld.c:5: 错误: stray ‘\226’ in program
helloworld.c:5: 错误: stray ‘\128’ in program
helloworld.c:5: 错误: stray ‘\156’ in program
helloworld.c:5: 错误: ‘hello’ 未声明 (在此函数内第一次使用)
helloworld.c:5: 错误: (即使在一个函数内多次出现,每个未声明的标识符在其
helloworld.c:5: 错误: 所在的函数内只报告一次。)
helloworld.c:5: 错误: 程序中有游离的 ‘\’
helloworld.c:5: 错误: ‘world’ 未声明 (在此函数内第一次使用)
helloworld.c:5: 错误: syntax error before ‘n’
helloworld.c:5: 错误: stray ‘\226’ in program
helloworld.c:5: 错误: stray ‘\128’ in program
helloworld.c:5: 错误: stray ‘\157’ in program
tjitty@tjitty-desktop:~/Desktop/work/LinuxCoding$
敢不敢先把你的程序贴出来
tjitty
帖子: 3
注册时间: 2008-03-26 15:34

#14

帖子 tjitty » 2008-03-27 16:59

明白啦,是有几个字符的问题。。。直接复制网页上的,导致错误。
flyinflash
帖子: 2376
注册时间: 2006-09-21 14:28

#15

帖子 flyinflash » 2008-03-31 13:36

http://www.shuge.org/share/project/gent ... 4%E7%94%A8

编译型语言 C

想入门,有三本书是必看的。
《C 程序设计语言》
《Linux 程序设计》
《Unix 环境高级编程》
回复