Linux g++ conio.h:没有这样的文件或目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6565924/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
g++ conio.h: no such file or directory
提问by atoMerz
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.
我正在尝试用 g++ 编写一个使用conio.h
标头的程序。我真正想做的是调用gotoxy
我在 Borland 编译器和 Windows 操作系统中使用的函数。
So the first question is: is there a gotoxy
function or equivalent in g++?
所以第一个问题是:gotoxy
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).
第二:为什么我不能包含 conio.h?我读了一些说我应该安装的东西libstdc++ package
,我试过了,但似乎我已经有了它(它伴随着 gcc)。
采纳答案by vines
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
.
g++ 没有直接的等价物。conio.h
特定于某些 DOS 编译器。但是你可以使用ncurses
library得到你想要的东西,它的功能类似于conio.h
.
Here's a link to a very elaborate tutorial: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/
这是一个非常详细的教程的链接:http: //tldp.org/HOWTO/NCURSES-Programming-HOWTO/
回答by geekosaur
conio.h
is specific to the Windows console environment. Use the curses
or ncurses
library on Unix; the appropriate function is mvcur()
in the low level interface and wmove()
in the virtual window interface.
conio.h
特定于 Windows 控制台环境。在 Unix 上使用curses
orncurses
库;适当的功能mvcur()
在低级界面和wmove()
虚拟窗口界面中。
回答by Mikhail
Well its not in gcc but it does come with MiniGW. It is specific to Windows.
好吧,它不在 gcc 中,但它确实带有 MiniGW。它特定于 Windows。
For linux you want the ncurses library.
对于 linux,您需要 ncurses 库。