-2

I have a software that was build in DOS in C language and I am trying to covert that into Linux but some of the libraries does not work in Linux, like conio.h, graphics.h! I am trying to find replacement function for textmode which includes in conio.h. Please help me to find replacement function! Feel free to recommend me a book or article if that help me to covert my code from DOS to Linux.

1
  • This question is not about computer hardware or software, within the scope defined in the help center.
    – Ramhound
    Jan 30, 2019 at 20:50

1 Answer 1

-1

These header files are unique to Windows and do not exist on Linux, although there are good alternatives.

For conio.h, most of the functions exist also in Linux under the same name. You can use the man command to find out where they live, for example using man getc, so most of what you will need to do is switch header files.

You may also have a look for conio.h at the Linux c++ implementation of conio.h, described as:

Simple Linux implementation of Borland's conio (conio.h) library. It uses Ncurses. It includes most functions required to write a basic application using conioh (i.e. getch(), cprintf(), puts() and more).

For graphics.h the situation is more complex and requires using alternative packages. You could have a look at libsdl or Allegro.

Or if this port is too complex, you may likely be able to run the Windows-compiled program .exe on Linux using Wine. See the following article: How to Install and Use Wine to Run Windows Applications on Linux.

6
  • Please stop answering off-topic questions. It's not the first time you have done this ...
    – DavidPostill
    Jan 30, 2019 at 21:50
  • @DavidPostill: This post is not off-topic. There isn't one line of code in the post or answer. The post talks about porting software between operating systems, and the answer lists software tools, all worthy of SU. The poster listed include files, which are just code-words for libraries/DLLs, still ok for SU. I could easily change a few words in the post to make it "acceptable".
    – harrymc
    Jan 31, 2019 at 7:49
  • Thank you! I am sorry for asking "off-topic" questions.
    – Insane
    Jan 31, 2019 at 12:43
  • I still think this was not off-topic, but rather that some people didn't like the naming of include files. But I'm in minority opinion here.
    – harrymc
    Jan 31, 2019 at 13:54
  • It is off-topic. Not only is it a programming question, but it explicitly asks "Please help me to find replacement function! Feel free to recommend me a book or article if that help me to covert my code from DOS to Linux.". There is an off-topic close reason which says "Questions seeking product, service, or learning material recommendations are off-topic" which also applies to this question.
    – DavidPostill
    Jan 31, 2019 at 18:36

Not the answer you're looking for? Browse other questions tagged .