g ++ conio.h:没有这样的文件或目录 [英] g++ conio.h: no such file or directory

查看:1523
本文介绍了g ++ conio.h:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用g ++编写一个使用 conio.h 标题的程序。
我实际上想要做的是调用Borland编译器和Windows操作系统中使用的 gotoxy 函数。

所以第一个问题是:在g ++中是否存在 gotoxy 函数或等价函数?

第二:为什么我不能包含conio.h?我读过一些说我应该安装 libstdc ++ package 的东西,我试过了,但似乎我已经拥有了它(它附有gcc)。

解决方案

g ++没有直接的等价物。 conio.h 特定于某些DOS编译器。但是你可以用 ncurses 库得到你想要的结果,它的功能类似于 conio.h 中的功能。 p>

下面是一个非常详细的教程链接: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/


I'm trying to write a program with g++ that uses conio.h header. What I'm actually trying to do is calling gotoxy function which I used in Borland compiler and windows OS.

So the first question is: is there a gotoxy function or equivalent in g++?

Second: why can't I include conio.h? I read some stuff that said I should install libstdc++ package, I tried but it seems that I already have it (it's accompanied by gcc).

解决方案

There's no direct equivalent for g++. conio.h is specific to some DOS compilers. But you can get what you want using ncurses library, its functions are similar to ones in conio.h.

Here's a link to a very elaborate tutorial: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/

这篇关于g ++ conio.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆