Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

opening the include file iostream.h

Guest (Visitor) (OP)
26 Jul 02 11:33
hi,
  i am new to c++ and i am just learning the hello world program. my compiler is "borland turbo c++" and the program is as follows (which you already know):

 #include <iostream.h>


 int main();
 {
 cout <<"Hello World!\n";
     return 0;
 }
 

but when i compile the program, it gives me two errors:-
   1)unable to open file include file iostream.h (line 1)
   2)declaration terminated incorrectly (line 5)

For the first problem, a book said "check your compiler documentation for directions on setting up your include path or environment variables", but i don't no what it means. so could you please give me a solution?
                                       Thank you very much.
Wings (Programmer)
26 Jul 02 14:34
try locating the iostream.h file on your drive (do a search for it in windows explorer) then look at its properties and copy the path. Paste the path in the include
for example

#include <D:\Program Files\Borland\CBuilder\Include\iostream.h>
Guest (Visitor) (OP)
26 Jul 02 23:34
i tried it but it doesn't work. i don't think the trouble is to find the file but to open it. so if u know a way to fix it please let me know.
                                    thanks
Guest (Visitor) (OP)
26 Jul 02 23:35
i tried it but it doesn't work. i don't think the trouble is to find the file but to open it. so if u know a way to fix it please let me know.
                                    thanks
chipperMDW (Programmer)
27 Jul 02 4:03
The problem is that it can't find the file and thus can't open it. So if you tried what Wings suggested and you didn't find the file at all, then it's possible that you just don't have the file, which would be bad. I'd suggest looking again, and if you still can't find it, see if you installed everything properly.

I don't think this could be what's wrong, but before you reinstall or anything, try removing the .h and just saying #include <iostream>.
Guest (Visitor) (OP)
27 Jul 02 23:23
i am sorry but just putting iostream doesn't help either. and before, it used to say that it couldn't "find" the file, but now it says that it can't "open" it(i changed the environment variable path in my computer\properties). so that's why i thought that the problem was opening and not finding it. thanks for helping.
Oak (Programmer)
29 Jul 02 23:57
Also remove ; at line int main();

Guest (Visitor) (OP)
4 Aug 02 9:27
hi,
  when i told someone my problem, he asked me whether i had the file iLink32.cfg. i saw that i didn't. is it important? could you please tell me how to get it and when i do, how to use it? thank you.
Guest (Visitor) (OP)
4 Aug 02 9:28
hi,
  when i told someone my problem, he asked me whether i had the file iLink32.cfg. i saw that i didn't. is it important? could you please tell me how to get it and when i do, how to use it? thank you.
2ffat (Programmer)
5 Aug 02 8:12
The link config file is not necessary if all your Turbo C++ directories are in your path. Can you open your iostream header file with an editor like EDIT? If not, your file may be trashed. BTW, have you followed that advise about the extra ';'?

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that they think I am now
qualified to do anything with nothing.

Guest (Visitor) (OP)
10 Sep 02 23:05
hey when i say #include <iostream.h> it didnt work so i tried putting the path by searching with explorer and then copying. it still didnt work but now it says it just cant open it. i tried removing the h and it still says it cant open it. so now i have #include <C:\TC\INCLUDE\iostream> and it still doesnt work. whats wrong?
chipperMDW (Programmer)
11 Sep 02 23:52
The backslash is an escape character in C++; that is, it causes the next character to be interpreted specially. If you really want a backslash, you have to put two (the first one causes the next backslash to be interpreted as a regular backslash). So you'd need:

#include <C:\\TC\\INCLUDE\\iostream>
Guest (Visitor) (OP)
12 Sep 02 21:32
ok will i did that and it still didnt work. i dont know y. isnt it when u type #include that it is supposed to like highlite the words? it doesnt do that. is that just because it is an older compiler. i know my comp has the libraries it say it just cant open them. did i set something up wrong. reinstalling didnt work...
Guest (Visitor) (OP)
12 Sep 02 21:53
can u name everything u are supposed to do after u install before u are supposed to actually start writing programs?
chipperMDW (Programmer)
13 Sep 02 15:01
Highlighting doesn't have anything to do with it; that's a function of the editor, not something in C++. You say you're using Turbo C++? Look on the menus for "Directories." Make sure the include path is set to the place where your include files are located.
Guest (Visitor) (OP)
13 Sep 02 15:39
well i checked and it was set to the right place but it still says it is unable to open include file  c:\\tc\\include\\iostream     i tried #include iostream.h and iostream    it still didnt work. y cant it open up the file.  i am using the borland turbo c++ v1.01   yes it is old but it should still work since i checked and it does have all the libraries like iostream and conio
Guest (Visitor) (OP)
14 Sep 02 20:29
???????????
Guest (Visitor) (OP)
14 Sep 02 23:01
please help me
schbounz (Programmer)
15 Sep 02 6:48
This should work :

#include <iostream>
using namespace std;





chipperMDW (Programmer)
15 Sep 02 16:15
No, it's not a namespace problem. In fact, the version of Turbo C++ being discussed didn't even have namespaces.

need to know, what were you saying earlier about highlighting? On my Turbo C++ 3.0 (a little later than yours), starting any line with a # makes the background light blue and the words dark blue (by default). What color is your background/text for the include line?

If it's all yellow, it's possible it thinks the file is a regular text file. I doubt that's the case, since it knows it's looking for an include file, but let's check anyway.
Guest (Visitor) (OP)
15 Sep 02 22:00
when i start to type in #include it is the same color as anything else i type. when i type:
#include <iostream.h>

int main()
{
cout << "hello world";
return (0);
}

everything is the same color. the include is yellow just like everything else
chipperMDW (Programmer)
16 Sep 02 2:34
Ok. So it seems the editor thinks your file is something other than a source file; probably just plain text. What's the extension on the file you're trying to write? If it's .txt (or anything besides .cpp), try saving it as a .cpp instead.
Guest (Visitor) (OP)
16 Sep 02 21:28
FINALLY THAT WORKED. IT WASNT SAVED AS .CPP IT WAS JUST .C  THANK U SOOOO MUCH I WOULD HAVE NEVER FIGURED THAT OUT.

:)
Guest (Visitor) (OP)
16 Sep 02 21:37
i downloaded the most recent version of borland i could find and after i installed it i couldnt find an icon to click on to start it. how do u start it?????
chipperMDW (Programmer)
16 Sep 02 22:24
It'll probably be wherever you downloaded it to. Look in C:\Program Files\Borland or somewhere around there. If you want an icon on your desktop, make a shortcut to it there.
Guest (Visitor) (OP)
17 Sep 02 17:17
i know where the hole folder is and everything just for some reason i cant find or just dont know what to click on to start it.
Guest (Visitor) (OP)
17 Sep 02 22:39
like i can find the folder just dont know what to click on to make the program start
chipperMDW (Programmer)
17 Sep 02 23:29
On my DOS Turbo 3.0, the executable is in the Bin subdirectory. It's called TC. It has an MS-DOS symbol. See if that's there for you.
Guest (Visitor) (OP)
18 Sep 02 20:58
yeah in my old version it is called TC in the bin directory so i checked there for the newer one and TC wasnt there. also i clicked on like every icon int he bin directory to see if it was something else and i still didnt find it
Guest (Visitor) (OP)
18 Sep 02 21:28
i tried to read the readme and it didnt tell me nothin. i have been lookin around the web to see if i could find something about it and i cant. where is the icon to start this stupid thing?
chipperMDW (Programmer)
18 Sep 02 23:42
I don't have the newest version of Borland... or even a recent version of Borland. You'd probably get more response if you started a new thread for this topic so someone else who does have it can answer you.
Guest (Visitor) (OP)
19 Sep 02 19:34
ok thx for everything
Snooperz (TechnicalUser)
2 Jun 03 21:54
Hey guys, well i've followed this post, tried everything mentioned and nothings worked for me yet with the same problem. yes i have all the libraries, and they are all pointed at using file > changedir   ..  but it keeps saying "unable to open include file 'IOSTREAM.H'  this is where i start ripping my hair out because ive tried it with 3 different copies of turbo c++ from different sources and versions for that matter.  yet the problem wont go away, would be using windows xp have anything to do with it?
2ffat (Programmer)
3 Jun 03 7:53
It shouldn't. I'm using BCB on XP. Have you downloaded the free version of C++ from Borland? It is the same compiler as BCB5 and 6 (I think) but without the IDE. This is a head scracher. Do you have read permission on the directories?

James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
        Albert Einstein explaining his Theory of Relativity to a group of journalists.

butthead (Programmer)
3 Jun 03 19:15
did you check your environment.

autoexecbat setpath , path and such. maybe the path is not set properly. or has XP done away with this monster.
2ffat (Programmer)
4 Jun 03 8:00
XP uses paths just like W2K. The paths are set up in My Computer -> Properties -> Advanced -> Enviromental Variables. I suppose somthing in the registry could be messed up.

James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
        Albert Einstein explaining his Theory of Relativity to a group of journalists.

Snooperz (TechnicalUser)
4 Jun 03 15:39
I got it guys thanks for the help.  Apparently turbo C++ doesn't like any drive but C:\   which i see no reason of it doing, maybe there was another problem and moving it to C:\ just cancelled it out.  Not sure, anyway its fixed thanks :)

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close