LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2148|回复: 14

GCC 提示没有stdio.h文件。

[复制链接]
发表于 2005-8-26 17:05:00 | 显示全部楼层 |阅读模式
gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,ob jc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexi t --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gn u --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux-gnu
Thread model: posix
gcc version 3.3.6 (Debian 1:3.3.6-7)


我安装了kernel source,还是提示。有点摸不着头脑。
发表于 2005-8-26 17:16:04 | 显示全部楼层
有没有安装glibc啊?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 17:21:16 | 显示全部楼层
apt-get install glibc 好像提示没有,尝试过了, libc5, libc6都安装了饿。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 17:25:59 | 显示全部楼层
apt-get install libuclibc0 libc6-dev libuclibc-dev
这样好像才搞定了。
回复 支持 反对

使用道具 举报

发表于 2005-8-26 17:38:09 | 显示全部楼层
apt-get install apt-file
apt-file update
apt-file search stdio.h
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 18:04:16 | 显示全部楼层
#include <stdio.h>
      
      3
      4 void lgc(void);
      5 char answer;
      6
      7 int main()
      8 {
      9     char a;
     10     clrscr();
     11     gotoxy(12,3);
     12     puts("Welcomto to Linux");
     13     gotoxy(15,13);
     14     printf("<CR>--Continue");
     15
     16     while(1)
     17     {
     18        a=getch();
     19        if(a==27)
     20           break;
     21        if(a==13)
     22          {
     23            lgc();
     24            if(answer=='y' || answer=='Y')
     25             {
     26               gotoxy(23,14);
     27               puts("lease write to the Linux");
     28               getch();
     29               break;
     30             }
     31          }
     32     }
     33   return(0);
     34 }
     35
     36 void lgc(void)
     37 {
     38     clrscr();
     39     gotoxy(12,8);
     40     printf("The Excellent Selection!");
     41     gotoxy(21,12);
     42     printf("Do you have any question?(Y/N)");
     43     answer=getch();
     44 }


gcc -o 1 1.c
/tmp/ccTmsCEl.o: In function `main':
1.c.text+0x1d): undefined reference to `clrscr'
1.c.text+0x29): undefined reference to `gotoxy'
1.c.text+0x48): undefined reference to `gotoxy'
1.c.text+0x62): undefined reference to `getch'
1.c.text+0x94): undefined reference to `gotoxy'
1.c.text+0xac): undefined reference to `getch'
/tmp/ccTmsCEl.o: In function `lgc':
1.c.text+0xbe): undefined reference to `clrscr'
1.c.text+0xca): undefined reference to `gotoxy'
1.c.text+0xe9): undefined reference to `gotoxy'
1.c.text+0x101): undefined reference to `getch'
collect2: ld returned 1 exit status


怎么提示的错误,没有显示行号?? 怎么是十六进制的?/    clrscr,gotoxy 需要那些头文件,现在有点忘了

#include <system.h>  也找不到这个头文件,我要把常用的头文件都装好,要怎么装呀??
回复 支持 反对

使用道具 举报

发表于 2005-8-26 20:06:14 | 显示全部楼层
apt-get build-dep gaim
回复 支持 反对

使用道具 举报

发表于 2005-8-26 20:12:08 | 显示全部楼层
Post by mantou
#include <stdio.h>
      
      3
      4 void lgc(void);
      5 char answer;
      6
      7 int main()
      8 {
      9     char a;
     10     clrscr();
     11     gotoxy(12,3);
     12     puts("Welcomto to Linux");
     13     gotoxy(15,13);
     14     printf("<CR>--Continue");
     15
     16     while(1)
     17     {
     18        a=getch();
     19        if(a==27)
     20           break;
     21        if(a==13)
     22          {
     23            lgc();
     24            if(answer=='y' || answer=='Y')
     25             {
     26               gotoxy(23,14);
     27               puts("lease write to the Linux");
     28               getch();
     29               break;
     30             }
     31          }
     32     }
     33   return(0);
     34 }
     35
     36 void lgc(void)
     37 {
     38     clrscr();
     39     gotoxy(12,8);
     40     printf("The Excellent Selection!");
     41     gotoxy(21,12);
     42     printf("Do you have any question?(Y/N)");
     43     answer=getch();
     44 }


gcc -o 1 1.c
/tmp/ccTmsCEl.o: In function `main':
1.c.text+0x1d): undefined reference to `clrscr'
1.c.text+0x29): undefined reference to `gotoxy'
1.c.text+0x48): undefined reference to `gotoxy'
1.c.text+0x62): undefined reference to `getch'
1.c.text+0x94): undefined reference to `gotoxy'
1.c.text+0xac): undefined reference to `getch'
/tmp/ccTmsCEl.o: In function `lgc':
1.c.text+0xbe): undefined reference to `clrscr'
1.c.text+0xca): undefined reference to `gotoxy'
1.c.text+0xe9): undefined reference to `gotoxy'
1.c.text+0x101): undefined reference to `getch'
collect2: ld returned 1 exit status


怎么提示的错误,没有显示行号?? 怎么是十六进制的?/    clrscr,gotoxy 需要那些头文件,现在有点忘了

#include <system.h>  也找不到这个头文件,我要把常用的头文件都装好,要怎么装呀??

这是什么程序?
不会是turbo C下面的画图函数吧?那我还是劝你改用其他的吧,或者回到windows去
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 22:24:40 | 显示全部楼层
兄弟能帮我找个比较好的Linux C的教程么? 偶以前学过C,现在有点忘记,需要回忆。搜索了下,没有找到合适的。我也在继续找。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-8-26 22:58:52 | 显示全部楼层
http://www.bellevuelinux.org/create_c1.html

自己来顶了,现在只好用Trubo C,和Linux C一起来了,以前学了C和数据结构,现在温习,主要是怕Linux 下C 编程有点和Trubo C会有点差异,所以,连E文的也来看了。不管了,坚持看下去。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表