linux 中的代码如何编译错误提示,Ubuntu 下GCC编译代码错误提示没有system.h和conio.h,如何得到这两个文件...

mudaizi12345 于 2015-01-23 23:42:50发表:

very good

mudaizi12345 于 2015-01-23 20:36:00发表:

路过试一试

菜菜123 于 2014-07-21 23:46:56发表:

看看

静水流深gzc 于 2014-07-18 15:07:04发表:

很好

l550747946 于 2014-07-10 17:34:15发表:

学习

emptii 于 2014-06-19 18:09:00发表:

thanx for sharing

GenaJoKingsor 于 2014-06-15 08:54:21发表:

谢谢2L,我也遇到了这个问题 头痛

hell0w0rld 于 2014-04-07 22:15:38发表:

zhaodao nile

chance_ 于 2013-07-05 14:03:42发表:

吧错吧错

lilacbear 于 2013-07-04 09:13:21发表:

需求中 搞一个试试

heliang000 于 2013-04-12 19:15:33发表:

matrix_zhang 于 2013-04-05 00:48:41发表:

我这遇到这情况

slan77 于 2013-01-28 15:13:01发表:

肯定和鼓励。

testff 于 2013-01-27 14:30:40发表:

这个能不能直接考到我的文

星空下的传说 于 2012-12-29 20:01:56发表:

试试

vaeshen 于 2012-12-29 03:57:46发表:

需要此文件

mgy130725 于 2011-06-15 19:04:55发表:

system.h真不好找啊~~~

waltt33 于 2011-04-21 12:27:04发表:

非标准库

szy200414 于 2011-04-06 05:37:53发表:

我来看看~~~我承认是被system.h吸引过来的~~~

deepwhite 于 2011-03-09 09:09:45发表:

引用:

谢谢。我还想问一下,那我用什么合适呢?

kingwl88 发表于 2011-3-7 22:53 back.gif

据我所知,没有可以直接使用的 API。

重写代码吧。

编写的时候尽量用标准 C 或者 POSIX 规范的 API,提高可移植性。

kingwl88 于 2011-03-07 22:53:14发表:

谢谢。我还想问一下,那我用什么合适呢?

deepwhite 于 2011-03-03 18:47:15发表:

conio.h is a C header file used in old MS-DOS compilers to create text user interfaces. It is not described in The C Programming Language book, and it is not part of the C standard library, ISO C nor is it required by POSIX.

From http://en.wikipedia.org/wiki/Conio.h

你用了 Windows 平台特有的头文件和 API。

Linux 不能在 Linux 下编译。

kingwl88 于 2011-03-03 16:12:44发表:

上边是我练习的代码,请两位给看看,现在把system.h加进去里,还是会报错,错误如下:(该如何解决,初学者不懂呀,还请指教,谢谢)

wangliang@ubuntu:~$ gcc -Wall 九九乘法表.c -o 九九乘法表

九九乘法表.c:2:19: error: conio.h: 没有那个文件或目录

In file included from 九九乘法表.c:3:

system.h:4:21: error: asm/asm.h: 没有那个文件或目录

system.h:5:25: error: asm/segment.h: 没有那个文件或目录

system.h:6:28: error: asm/cpufeature.h: 没有那个文件或目录

system.h:7:25: error: asm/cmpxchg.h: 没有那个文件或目录

system.h:8:22: error: asm/nops.h: 没有那个文件或目录

system.h:11:28: error: linux/irqflags.h: 没有那个文件或目录

In file included from 九九乘法表.c:3:

system.h: In function ‘clflush’:

system.h:335: error: expected ‘)’ before ‘__force’

system.h:335: warning: cast from pointer to integer of different size

system.h:335: error: invalid type argument of ‘unary *’ (have ‘int’)

system.h:335: error: invalid lvalue in asm output 0

system.h:335: error: memory input 1 is not directly addressable

system.h: In function ‘rdtsc_barrier’:

system.h:456: warning: implicit declaration of function ‘alternative’

system.h:456: error: ‘ASM_NOP3’ undeclared (first use in this function)

system.h:456: error: (Each undeclared identifier is reported only once

system.h:456: error: for each function it appears in.)

system.h:456: error: ‘X86_FEATURE_MFENCE_RDTSC’ undeclared (first use in this function)

system.h:457: error: ‘X86_FEATURE_LFENCE_RDTSC’ undeclared (first use in this function)

九九乘法表.c: In function ‘main’:

九九乘法表.c:8: warning: implicit declaration of function ‘clrscr’

九九乘法表.c:15: warning: implicit declaration of function ‘gotoxy’

kingwl88 于 2011-03-03 16:09:25发表:

#include #include #include main ()

{

int i,j,x,y;

clrscr(); /*清屏*/

printf("\n\n***Pithy Formula Table of Multiplication***\n\n");

/*显示提示信息*/

x=9;

y=5; /*输出横轴数字*/

for(i=1;i<=9;i++)

{

gotoxy(x,y); /*移到指定的光标位置*/

printf("%2d ",i); /*打印横轴数字*/

x+=3;

}

x=7;

y=6; /*输出纵轴数字*/

for(i=1;i<=9;i++)

{

gotoxy(x,y); /*移到指定的光标位置*/

printf("%2d\n",j);/*打印纵轴数字*/

y++;

}

x=9;

y=6;

/*计算并显示1*1~9*9*/

for(i=1;i<=9;i++)

{

for(j=1;j<=9;j++)

{

gotoxy(x,y); /*移到指定的光标位置*/

printf("%2d ",i*j); /*打印乘法结果*/

y++;

}

y-=9;

x+=3;

}

printf("\n\n Press any key to quit...\n");

getchar();

}

deepwhite 于 2011-03-03 09:04:50发表:

引用:

http://baike.baidu.com/view/1623334.htm

看这个样子gcc是不支持的了。

至于system.h,在我的机器上找到一个,可以上传上来,位于/usr/src/kernels/2.6.35.11-83.fc14.i686/arch/x86/include/asm/system.h能不能 ...

pallana 发表于 2011-3-2 21:15 back.gif

呵呵,光这样肯定不行的。

关键还得看LZ的代码。

pallana 于 2011-03-02 21:15:34发表:

引用:

用法

conio 库用于 Window 平台,与之类似的在 Linux 下使用 curses 库。

看这个样子gcc是不支持的了。

至于system.h,在我的机器上找到一个,可以上传上来,位于[code]/usr/src/kernels/2.6.35.11-83.fc14.i686/arch/x86/include/asm/system.h[/code]能不能用不敢保证

论坛不支持.h文件上传,压缩了,解压即可。

[attach]33845[/attach]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值