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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Unable to open include file ' istream'". Beginner in C++

Status
Not open for further replies.

idiom

Programmer
Nov 7, 2002
4
US
this is my code:


// main.cpp module


#include <C:\Borland\BCC55\Include\iostream.h>

using namespace std;


int main(void)
{
// Without &quot;using&quot; statement, this would be std::cout

:cout << &quot;Hi kate!&quot; << end1; // &quot;end1&quot; = next line
return 0;
}


this is the error message:


C:\MYSOURCE>bcc32 main.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
main.cpp:
Error E2209 C:\Borland\BCC55\Include\iostream.h 36: Unable to open include file
'stdcomp.h'
Error E2209 C:\Borland\BCC55\Include\iostream.h 37: Unable to open include file
'istream'
Error E2209 C:\Borland\BCC55\Include\iostream.h 38: Unable to open include file
'ostream'
Error E2141 C:\Borland\BCC55\Include\iostream.h 44: Declaration syntax error
Error E2141 C:\Borland\BCC55\Include\iostream.h 47: Declaration syntax error
Error E2188 main.cpp 13: Expression syntax in function main()
*** 6 errors in Compile ***

I am using the free compliler from Borland, please help me, this is my first C++ program and any help would be good.
-thanks

 
Try

#include <iostream>

Note: there is no .h
 
I have tried that, it does not work.
 
Hmm...

Dunno about the include file, but you have a colon right before cout in your main program. That shouldn't be there.
 
yeah, I don't know either. I just changed compilers and it seems to be working fine now, changed from borland to microsoft.
 
I actually had this problem a short time ago, after reading the documentation I discovered you had to use the -I and -L options. I did this by using a .cfg file.

Here is an excert from the readme that explains how to do it:

From the bin directory of your installation:
a. Add &quot;c:\Borland\Bcc55&quot;
to the existing path
b. Create a bcc32.cfg file which will set
the compiler options for the Include
and Lib paths (-I and -L switches to
compiler) by adding these lines:
-I&quot;c:\Borland\Bcc55\include&quot;
-L&quot;c:\Borland\Bcc55\lib&quot;
c. Create an ilink32.cfg file which will set
the linker option for the Lib path by
adding this line:
-L&quot;c:\Borland\Bcc55\lib&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top