We started learning C++ in our class at school a few months ago, and hence, we have to download and use Turbo C++ 3.0 (90s software, ugh), as we don't have to change the syntax at all. Till now, I managed on Code::Blocks on my sister's Windows, but I want to install Turbo C++ 3.0 on my Mac. I know we can do it using DosBox, and after following a few instructions, I did get the blue screen to come up on my Mac.

However, on running a simple Hello World program, I'm getting the following errors:
UNABLE TO OPEN INCLUDE FILE 'IOSTREAM.H'.
UNABLE TO OPEN INCLUDE FILE 'CONIO.H'.
and a bunch of other errors all related to this.

Can anyone suggest how to fix this?

I cannot download xcode as it is too big for my net connection, and i cannot build GCC on my own.

Dani AI

Generated

The error messages mean the DOS compiler inside DOSBox cannot find the Turbo C++ header files. In a proper Turbo C++ 3.0 install the compiler expects a directory structure like BIN, INCLUDE and LIB; missing or incorrectly mounted INCLUDE files cause the exact "UNABLE TO OPEN INCLUDE FILE" errors reported. As and noted, modern compilers use different headers (no trailing ".h") and / rightly encourage using an up-to-date toolchain — but if the class forces Turbo C++ inside DOSBox, confirm the old headers are actually present and accessible first.

Quick checklist and actions to apply inside DOSBox (replace paths with your actual Mac path):

mount c /full/path/to/parent-folder-containing-TC
c:
dir c:\tc\include
cd c:\tc\bin
tc.exe

If the dir c:\tc\include listing does not show files like iostream.h or conio.h, the Turbo C++ package was not unpacked fully into the mounted folder. Re-extract a complete Turbo C++ distribution into the folder you mounted. If the files are present but the IDE still errors, open the Turbo C++ IDE and verify Options -> Directories -> Include points to C:\TC\INCLUDE. Note: conio.h is a Borland-specific header (non-standard); if switching to a modern compiler is possible, ask the instructor for permission — standard C++ uses different headers and portable replacements for conio functions. For very low-bandwidth situations, try compiling small programs on a public machine (library or school lab) or use a lightweight online compiler until Turbo C++ is available.

Recommended Answers

All 7 Replies

Hello,

some compilers (especially with C++) only allow this:

#include <iostream>
....

Could try taking the .h. Is there no way you cannot install GCC?

It looks like someone is short on their libraries. I take it that you approached your instructor with the problem? She said "what an interesting delima you have here, this is a good learning experence for you", and then left you high and dry. Welcome to the real world. She really didn't, she wants to see what you can do.
Told nothing, expect miracles. Why is everybody picking on me? Bla,bla,bla. This is a relativly simple problem and well within your abilities to fix, even though you do not realize it.
I really would recommend loading xcode on your system. You state that you do not have the banwidth to do so... at home. Then go to your library! Better yet, set up an appointment with a genius at the apple store and if you are up front with your problem they will show you what libraries to load and how to load them and they would probably download xcode right there.
A good resource that you should check out is source forge (sourceforge.net). They have all the libraries that you could need and then some. You can even pick up some quality routines.
You now have the resources that you need, now it is up to you what you do with them. The more that you can think your way out of a box, the better chance you will have out in the real world.

take away the .h

Anyone can tell me, how to use Xcode to write c program? thx before hand.

Follow my blog.. I have discussed here on how to get turbo c running using dosbox in Mac OSX

Apple's Xcode IDE (free download) comes with 4 languages ...
C
C++
Objective C
Swift
When you start a new project it will ask which of these you want to use.

I would dump the instructor that insists on using Turbo C++! Just too lazy to change lecture notes. That thing is medieval! Besides, you miss out on all the great features that have been added with C++11.

i have installed dosbox turbo but complier is not working will u please suggest what can i do......

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.