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 Forums!
  • 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

Share

opening the include file iostream.h

opening the include file iostream.h

(OP)
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.

RE: opening the include file iostream.h

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>

RE: opening the include file iostream.h

(OP)
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

RE: opening the include file iostream.h

(OP)
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

RE: opening the include file iostream.h

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>.

RE: opening the include file iostream.h

(OP)
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.

RE: opening the include file iostream.h

Also remove ; at line int main();

RE: opening the include file iostream.h

(OP)
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.

RE: opening the include file iostream.h

(OP)
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.

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

(OP)
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?

RE: opening the include file iostream.h

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>

RE: opening the include file iostream.h

(OP)
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...

RE: opening the include file iostream.h

(OP)
can u name everything u are supposed to do after u install before u are supposed to actually start writing programs?

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

(OP)
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

RE: opening the include file iostream.h

(OP)
???????????

RE: opening the include file iostream.h

(OP)
please help me

RE: opening the include file iostream.h

This should work :

#include <iostream>
using namespace std;





RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

(OP)
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

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

(OP)
FINALLY THAT WORKED. IT WASNT SAVED AS .CPP IT WAS JUST .C  THANK U SOOOO MUCH I WOULD HAVE NEVER FIGURED THAT OUT.

:)

RE: opening the include file iostream.h

(OP)
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?????

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

(OP)
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.

RE: opening the include file iostream.h

(OP)
like i can find the folder just dont know what to click on to make the program start

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

(OP)
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

RE: opening the include file iostream.h

(OP)
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?

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

(OP)
ok thx for everything

RE: opening the include file iostream.h

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?

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

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.

RE: opening the include file iostream.h

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!

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