• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to bind the header file :conio.h  RSS feed

 
girish rateshwar
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I have a c++ program (password.cc) which contains a header file conio.h.
Now when i have copied this file on my linux machine and try to compile it : g++ password.cc
I get the following error:
conio.h No such file or directory.
To resolve this i tried to look for the header file and managed to get it from my friend and copied it to /usr/i386-glibc21-linux/include
But i keep gettin the same error!
Do i have the original conio.h or there is some otehr way of doin it.
Help Appreciated
 
Tim Holloway
Saloon Keeper
Posts: 18799
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think conio.h was an old (and I mean REALLY old) DOS file header for doing things that you'd use curses for in a Unix/Linux environment. It may have been a Borland-specific function.
So most likely you'll have to do some rewriting.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
conio.h is a C headerfile for doing con(sole) IO. It could well be OS specific of course, but I think I also saw it in MSVC (don't have it installed here so can't check).
check out stdio.h and stdlib.h instead which is pretty much platform independent and is there.
btw, the include files are in /usr/include at least on my machine.
You could always try putting conio.h with your .cc file and referencing it as a local include, but you'd likely get linker errors from missing libraries referenced from conio.h (DOS system calls) if you do so.
 
Tim Holloway
Saloon Keeper
Posts: 18799
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup. I'm sitting at a machine with Visual Studio on it and conio.h is part of the MSVC app. Mostly it's got cheap replacements for string input/output via the console, but I think the main thing I used it for was the getch() and kbhit() functions.
I think all these calls go straight to the BIOS. Linux runs on machines where BIOS's don't exist (which is EVERYTHING except IBM-PC machines), so conio doesn't work there.
It's mostly a simple conversion except for cases where you're trying to read passwords without echoing and do unbuffered character-at-a-time I/O. In the Unix environment, you have to use stty to alter the default console operations.
 
girish rateshwar
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Tim,
I know im asking for more, but thats what javaranch is good at
Well im developing an interface where im connecting to mysql and validating the username and password. I need to change the text 'abc' -->> '***' on linux. Im developing this in c++.
Can u pls let me know if there is any code available with u?
Thanks!!!
 
Tim Holloway
Saloon Keeper
Posts: 18799
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid I don't have anything I can dig out. This website looks like it may help though. I found it off Google:
http://puggy.symonds.net/~deep/stuff/tekmail/unixfun.php
By convention, Unix doesn't echo stars when you're entering a passwrod-like field. For one thing, even allowing casual viewers to see how many characters in the password is considered a possibly valuable clue.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!