Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening the include file iostream.h

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
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 <<&quot;Hello World!\n&quot;;
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 &quot;check your compiler documentation for directions on setting up your include path or environment variables&quot;, but i don't no what it means. so could you please give me a solution?
Thank you very much.
 
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 << &quot;hello world&quot;;
return (0);
}

everything is the same color. the include is yellow just like everything else
 
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.
 
FINALLY THAT WORKED. IT WASNT SAVED AS .CPP IT WAS JUST .C THANK U SOOOO MUCH I WOULD HAVE NEVER FIGURED THAT OUT.

:)
 
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?????
 
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.
 
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.
 
like i can find the folder just dont know what to click on to make the program start
 
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.
 
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
 
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?
 
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.
 
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 &quot;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?
 
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.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
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.
 
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.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
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 :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top