[问题]请教,ubantu如何安装c compiler?

重复贴和参考价值不大的帖子,版主维护
emergency
帖子: 7
注册时间: 2007-11-09 10:20
送出感谢: 0
接收感谢: 0

[问题]请教,ubantu如何安装c compiler?

#1

帖子 emergency » 2007-11-09 12:20

现在装的是ubuntu7.10,
从一个老外那要来的软件,make时报错,

cc -O2 -c -o swat.o swat.c
> In file included from swat.c:25:
> swat.h:25:19: error: ctype.h: No such file or directory
> swat.h:26:18: error: math.h: No such file or directory
> swat.h:27:19: error: stdio.h: No such file or directory
> In file included from swat.c:25:
> swat.h:87: error: expected specifier-qualifier-list before ‘FILE’
> swat.c: In function ‘main’:
> swat.c:55: error: ‘FILE’ undeclared (first use in this function)
> swat.c:55: error: (Each undeclared identifier is reported only once
> swat.c:55: error: for each function it appears in.)
> swat.c:55: error: ‘fr’ undeclared (first use in this function)
> swat.c:86: warning: incompatible implicit declaration of built-in
> function ‘printf’
> swat.c:134: warning: incompatible implicit declaration of built-in
> function ‘fprintf’
> swat.c:134: error: ‘stderr’ undeclared (first use in this function)
> swat.c:142: error: ‘stdout’ undeclared (first use in this function)
> swat.c:230: warning: incompatible i
mplicit declaration of built-in
> function ‘strcpy’
> swat.c:231: warning: incompatible implicit declaration of built-in
> function ‘strcat’
> swat.c:273: warning: incompatible implicit declaration of built-in
> function ‘printf’
> make: *** [swat.o] Error 1

请教了一下老外,说是c compiler不完全
哪位兄弟有解决办法?
或者其它什么版本的linux好用?
谢谢!!
头像
jimhu
帖子: 1322
注册时间: 2006-01-25 22:29
来自: 上海
送出感谢: 0
接收感谢: 0
联系:

#2

帖子 jimhu » 2007-11-09 12:28

sudo apt-get install build-essential
大概是这样的。。。
emergency
帖子: 7
注册时间: 2007-11-09 10:20
送出感谢: 0
接收感谢: 0

#3

帖子 emergency » 2007-11-09 12:52

谢谢jimhu兄弟!
运行 sudo apt-get install build-essential 依然报错
继续请教,谢谢!

root@guo-laptop:~# sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
build-essential: Depends: libc6-dev but it is not going to be installed or
libc-dev
Depends: g++ (>= 4:4.1.1) but it is not going to be installed
dpkg: Breaks: dpkg-dev (< 1.14.0) but 1.13.24ubuntu6 is to be installed
E: Broken packages
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
送出感谢: 0
接收感谢: 2 次
联系:

#4

帖子 dbzhang800 » 2007-11-09 13:02

换个源试试呢?
emergency
帖子: 7
注册时间: 2007-11-09 10:20
送出感谢: 0
接收感谢: 0

#5

帖子 emergency » 2007-11-09 13:05

源是什么?
怎么换?
谢谢!
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
送出感谢: 0
接收感谢: 7 次
联系:

#6

帖子 BigSnake.NET » 2007-11-09 13:06

^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
woaiwojia
帖子: 1353
注册时间: 2007-09-10 20:20
系统: Debian
来自: 南京
送出感谢: 0
接收感谢: 0

#7

帖子 woaiwojia » 2007-11-09 13:07

看错误提示
emergency
帖子: 7
注册时间: 2007-11-09 10:20
送出感谢: 0
接收感谢: 0

#8

帖子 emergency » 2007-11-09 13:10

第一次接触linux,
请各位老大说得详细一点,谢谢!
emergency
帖子: 7
注册时间: 2007-11-09 10:20
送出感谢: 0
接收感谢: 0

#9

帖子 emergency » 2007-11-09 14:39

换了n个源了,问题依旧!
哪位兄弟有办法,谢谢!
njayong002
帖子: 17
注册时间: 2007-11-01 23:59
来自: 江苏南京
送出感谢: 0
接收感谢: 0

#10

帖子 njayong002 » 2007-11-09 14:50

新手真TM的烦,一天到晚都问这种白痴问题
身在L营心在W。。。
emergency
帖子: 7
注册时间: 2007-11-09 10:20
送出感谢: 0
接收感谢: 0

#11

帖子 emergency » 2007-11-09 15:11

不知道你这种所谓的“高手”到新手版来干什么!
头像
oneleaf
论坛管理员
帖子: 10209
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04
送出感谢: 7 次
接收感谢: 99 次

#12

帖子 oneleaf » 2007-11-09 16:46

安装错误的原因是 build-essential 依赖 libc6-dev、g++ 等,但是apt-get需要手工同时安装依赖包。

楼主可以使用:
sudo aptitude install build-essential

也可以(推荐):
直接到新立得搜寻 build-essential 包,按鼠标右键安装。
头像
chattan
论坛版主
帖子: 3922
注册时间: 2007-07-11 20:59
送出感谢: 0
接收感谢: 0
联系:

#13

帖子 chattan » 2007-11-09 16:57

是ubuntu不是你标题所打的"ubantu"
头像
FFFrog
帖子: 621
注册时间: 2006-05-12 23:28
来自: 江西乐平
送出感谢: 0
接收感谢: 1 次
联系:

#14

帖子 FFFrog » 2007-11-09 16:59

njayong002
10楼
现已禁止


002……原来已经处理过不止一次了。

对Ubuntu不满意,发发牢骚就算了。还跑到这里来混淆视听。
emergency
帖子: 7
注册时间: 2007-11-09 10:20
送出感谢: 0
接收感谢: 0

#15

帖子 emergency » 2007-11-10 23:34

重装了一次系统,直接安装G++搞定!
谢谢各位!
回复

回到 “归档贴”