How can I compile code that uses graphics.h in DOS

2019-07-22 15:53发布

问题:

i write a code and in this code i use graphics.h ,in borland c++ or visual I can't open and run it, now i want run this code ,and i have DOSBOX 0.72 , how open this code with DOSBOX? my windows is 7 32bit

回答1:

I see you're still trying to write and compile code that uses legacy and unsupported libraries...

At least you've discovered now that you aren't going to be able to do this natively in Windows 7, and have installed a DOS emulator. Now, you'll need to find and download a compiler that will run in that environment.

Since graphics.h is a proprietary Borland library, I recommend you use one of their compilers. The company who now owns Borland hosts an online museum of their vintage products that are free for download. Grab a copy of Turbo C 2.01 or Turbo C++ 1.01, load it on your DOSBOX, and marvel at the little piece of computer history you've unearthed.

Also, Turbo C 3.0 is available online from here, but I'm not sure this has been released to the public domain. I can't imagine anyone would really care, but legally and all, you're on your own.

But seriously, why not download Visual Studio C++ 2010 Express free from Microsoft and use a modern compiler instead? Sure you can't use graphics.h, but there have been a significant amount of developments made in computer graphics technology in the past 25+ years. A modern IDE will be much easier to use than the old Borland compilers, and the time you invest will actually be worth something.



回答2:

May be download and install borland c++ 3.11 compiler and use graphic.h library (i'm use it 4 years ago). I think that this compiler isn't ran in Win 7, but may be try. You can use Virtual Box, with installing Win XP (borland c++ 3.1 100% work in WinXP).



回答3:

The complete solution of running turbo C++ 3.0 in windows 7 is just disable graphics driver of your computer from device manager and use like windows Xp.

It will run turbo c++ in full screen as well as run graphics program in windows 7