LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   C++ app with DOS libs to GNU (https://www.linuxquestions.org/questions/programming-9/c-app-with-dos-libs-to-gnu-4175593471/)

thickglass 11-13-2016 05:12 PM

C++ app with DOS libs to GNU
 
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 :)

dugan 11-13-2016 07:05 PM

What is the app? Does it have a homepage? Can we download the source too?

What are the DOS functions that it uses?

What were "dos libs" and what were the "right folders" that you put them in?

Note: if you're asking what it sounds like you're asking, then consider the very strong possiblity that "it won't work in Linux" actually is the right answer. In that case, you'd have to build and run it using DosEMU, DosBox, a VM running FreeDOS, etc.

sundialsvcs 11-14-2016 08:43 AM

You might need to re-code this application somewhat in order to make it work. How easy this may be will depend entirely on just how the original was built.

If, for instance, there are subroutine calls that are used to request various DOS system services, these could be replaced on a case-wise basis by adding a new file to your application (with appropriate #include directives in the appropriate other places) in which you create an appropriate implementation of this functionality.

If, on the other hand, the application is chock-full of asm{...} sections with hard-coded int instructions, you'll have much more work to do.

If your DOS program expects to use libraries (other than components of itself ...) you will probably have to re-create the functionality of those libraries as well.

Likewise, how does the application do screen I/O and keyboard input? Some programs were very brutish, directly writing to display memory. Others made use of "GUI" (sic ...) libraries that you may or may not have.

As others have noted, tools like "DosBox" also exist. They put the program into an environment that reasonably mimics the DOS environment as seen by application programs.

astrogeek 11-14-2016 12:34 PM

Moved: This thread is more suitable in the programming forum and has been moved accordingly to help your thread/question get the exposure it deserves.

rtmistler 11-15-2016 01:07 PM

Member Response
 
Since I have no idea how helpful or good this application is and what the benefit it derives from DOS, my personal instinct would be rewrite the functionality entirely in C and compile it under Linux. Further, I could tweak it to do exactly what I'd want it to do, maybe even improve it.


All times are GMT -5. The time now is 06:58 AM.