OOo,TeX,KO,ABI,GIMP,Picasa,ProE,QCAD,Inkscape,Kicad,Eagle
-
ShengC
- 帖子: 11
- 注册时间: 2005-10-14 9:00
#1
帖子
由 ShengC » 2005-10-18 19:58
代码: 全选
shengc@ubuntu:~$ cat > Hello.c << EOF
> int main()
> {
> printf("Helo!");
> return 1;
> }
> EOF
shengc@ubuntu:~$ gcc Hello.c
Hello.c: 在函数 ‘main’ 中:
Hello.c:3: 警告:内建函数 ‘printf’ 不兼容的隐式声明
/usr/bin/ld: crt1.o: No such file: 没有那个文件或目录
collect2: ld 返回 1
shengc@ubuntu:~$
还要设置写什么东西?
以前都是系统已经预装好了gcc,所以现在。。。
-
yonsan
- 帖子: 887
- 注册时间: 2005-07-01 18:56
- 来自: 广州市
#2
帖子
由 yonsan » 2005-10-18 20:25
呵, 楼主强吖!
都没写上!
I will be back!
-
ShengC
- 帖子: 11
- 注册时间: 2005-10-14 9:00
#3
帖子
由 ShengC » 2005-10-18 21:21
yonsan 写了: 呵, 楼主强吖!
都没写上!
我在redhat9中输入的结果:
代码: 全选
[root@localhost root]# cat > temp.c << EOF
> int main()
> {
> printf("Hello");
> return 1;
> }
> EOF
[root@localhost root]# gcc -o temp temp.c
[root@localhost root]# ./temp
Hello
[root@localhost root]#
-
eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
#4
帖子
由 eexpress » 2005-10-18 23:09
那就是你的redhat不符合游戏规则。
● 鸣学
-
yonsan
- 帖子: 887
- 注册时间: 2005-07-01 18:56
- 来自: 广州市
#5
帖子
由 yonsan » 2005-10-19 0:25
是吖, 居然没有加 -Wall 参数都没警告一下!!
I will be back!
-
ShengC
- 帖子: 11
- 注册时间: 2005-10-14 9:00
#7
帖子
由 ShengC » 2005-10-19 12:22
你们的都可以用吗
我就是sudo apt-get install gcc
还要设置或者装什么其他的东西吗?
代码: 全选
shengc@ubuntu:~$ cat > temp.c << EOF
> #include <stdio.h>
> int main()
> {
> printf("Hello!\n");
> return 1;
> }
> EOF
shengc@ubuntu:~$ gcc -o temp temp.c
temp.c:1:19: error: stdio.h: 没有那个文件或目录
temp.c: 在函数 ‘main’ 中:
temp.c:4: 警告:内建函数 ‘printf’ 不兼容的隐式声明
shengc@ubuntu:~$
-
glade
- 帖子: 1383
- 注册时间: 2005-10-21 16:57
#8
帖子
由 glade » 2005-10-23 15:14
我也遇到相同的问题
一个Hello world这样的小程序也编译不了
-
catinsnow
- 帖子: 773
- 注册时间: 2005-08-02 7:23
- 来自: 上海
#9
帖子
由 catinsnow » 2005-10-23 15:35
我这里是可以的啊。用的是GCC3.4
Ubuntu Intrepid
#P4 2.4
P4 2.4C
#1024MB
2048MB
#120G
500G+120G
Nvidia FX5700
#ATI9100 --拆了,受不了ATI的驱动.
-
zhanglyl
- 帖子: 14
- 注册时间: 2005-09-02 8:05
#12
帖子
由 zhanglyl » 2005-10-23 15:53
是没有安装库文件的缘故啊!请参照下面的方法即可解决。
(Ubuntu 5.10)
1) sudo apt-get install gcc
2)sudo apt-get install libc6-dev
OK!
-
glade
- 帖子: 1383
- 注册时间: 2005-10-21 16:57
#13
帖子
由 glade » 2005-10-23 16:04
libc6-dev已经装过了
aa.c
代码: 全选
#include <stdio.h>
main()
{
printf("Hello World");
}
cc aa.c
编译通过
但是执行a.out的时候提示
a.out: error while loading shared libraries: tenv: cannot open shared object file: No such file or directory
怎么设置
-
glade
- 帖子: 1383
- 注册时间: 2005-10-21 16:57
#14
帖子
由 glade » 2005-10-23 16:12
按照linuxdown README的说明
出现很多错误
代码: 全选
root@Lee:~/linuxdown-1.2.0# make
gcc -lpthread -c -o Dandi.o Dandi.c
gcc: -lpthread: linker input file unused because linking not done
gcc -lpthread -c -o DownFromFTP.o DownFromFTP.c
DownFromFTP.c: In function ‘DownLoadFtp’:
DownFromFTP.c:55: warning: incompatible implicit declaration of built-in functio n ‘strlen’
DownFromFTP.c:77: warning: incompatible implicit declaration of built-in functio n ‘strstr’
gcc: -lpthread: linker input file unused because linking not done
gcc -lpthread -c -o DownFromHTTP.o DownFromHTTP.c
DownFromHTTP.c: In function ‘DownLoadHttp’:
DownFromHTTP.c:44: warning: incompatible implicit declaration of built-in functi on ‘strlen’
gcc: -lpthread: linker input file unused because linking not done
gcc -lpthread -c -o DandiBase.o DandiBase.c
gcc: -lpthread: linker input file unused because linking not done
gcc -lpthread -c -o GenFunc.o GenFunc.c
GenFunc.c:126: error: static declaration of ‘hash’ follows non-static declaratio n
GenFunc.h:82: error: previous declaration of ‘hash’ was here
GenFunc.c:297: error: static declaration of ‘call_hash’ follows non-static decla ration
GenFunc.h:83: error: previous declaration of ‘call_hash’ was here
GenFunc.c: In function ‘call_hash’:
GenFunc.c:326: warning: incompatible implicit declaration of built-in function ‘ memcpy’
.
.
.
此处省略n行
-
eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
#15
帖子
由 eexpress » 2005-10-23 16:39
tenv?
这是什么库啊。
warning: incompatible implicit declaration of built-in function ‘ memcpy’
这个是没有linux-headers
● 鸣学