C++ app with DOS libs to GNU

T

thickglass

Guest
Hi guys, here is one problem I came across recently - I have an app which operates with dos functions, so I tried to compile it with gnu and it doesn't seem to work due to the dos libs,even though I put them in right folders, I've made a little research and people were saying that dos doesn't fit well with linux and noone proposed any solution, could you guys recommend me something? Thank you, have a nice day
 


You need to provide more details, such as the "DOS functions" being called.

I would ass/u/me without seeing the code that you may be referring to functions provided by the header file, "conio.h". All functions provided by conio.h are in fact NOT compatible with Linux. You could alter the code to use Standard Library functions, or if needed use curses.
 
@rstanley - I think you have hit the nail on the head there.
Without knowing the exact details - it does sound very much like a "conio.h" related problem. An all to common stumbling block that people come across when trying to port older Windows/DOS applications to Unix-like OSes.

I am aware of a few small projects on various code-sharing sites which attempt to provide a Linux implementation of typical conio.h functions. From what I recall, most of them just use ncurses to implement similar functionality - so for example clrscr will use curses and terminfo/termcap to determine the ANSII escape sequence required to clear the screen and will then use curses to output the escape sequence to the screen - thus clearing the screen.
I haven't really taken a good look at any of them, so I don't know how complete or portable any of them are, but one of them might help the OP to port their application with minimal changes to their code-base.

@OP - try searching for "conio for Linux" - I'm sure you'll find one or more of these projects. Even if they are not complete, they might contain some more portable implementations of common conio functions. Couldn't hurt to take a look!
You are going to have to do some porting to get equivalent functionality anyway. If somebody else has already done a lot of the grunt-work, you can just piggy-back off their efforts! (At least, assuming that your code and their code are distributed under compatible licensing terms!)
 

Members online

No members online now.

Top