Board index » cppbuilder » Cannot compile with #include <iostream>

Cannot compile with #include <iostream>


2004-01-26 02:31:46 AM
cppbuilder55
I am working on a simple command line project, but every time I include
iostream, I get a long list of errors. I am using Bcc5.5, on a Windows98
machine. I edit and compile with Textpad 4.5. I used this setup with
WinXP and had no difficulty, but my current machine is 98SE. Briefly,
here is a test .cpp file
*******
#include <iostream>
using namespace std;
int main()
{
cout<<"this is a test";
return 0;
}
*******
I have tried this with and without "using namespace std", as <iostream>,
<iostream.h>and "iostream.h". I get the same errors. Here are the first
few:
Warning W8026 c:\John\class\csc\csc230\include130\exception 70:
Functions with exception specifications are not expanded inline
Warning W8026 c:\John\class\csc\csc230\include130\exception 70:
Functions with exception specifications are not expanded inline
Warning W8026 c:\John\class\csc\csc230\include130\new 20: Functions with
exception specifications are not expanded inline
Any help would be appreciated.
PS I am writing a class assignment, just full disclosure.
 
 

Re:Cannot compile with #include <iostream>

Quote
I am working on a simple command line project, but
every time I include iostream, I get a long list of errors. ...
There must have been a cut and paste problem. The message you posted does
not show any errors.
. Ed
Quote
John wrote in message
news:40140baa$ XXXX@XXXXX.COM ...
 

Re:Cannot compile with #include <iostream>

Ed Mulroy [TeamB] wrote:
Quote
>I am working on a simple command line project, but
>every time I include iostream, I get a long list of errors. ...


There must have been a cut and paste problem. The message you posted does
not show any errors.

. Ed


>John wrote in message
>news:40140baa$ XXXX@XXXXX.COM ...



My mistake. These are the first few errors:
Error E2451 c:\John\class\csc\csc230\include130\iosfwd 68: Undefined
symbol 'mbstate_t'
Error E2299 c:\John\class\csc\csc230\include130\iosfwd 68: Cannot
generate template specialization from 'fpos<_St>'
Error E2040 c:\John\class\csc\csc230\include130\iosfwd 68: Declaration
terminated incorrectly
Error E2257 c:\John\class\csc\csc230\include130\iosfwd 69: , expected
Error E2139 c:\John\class\csc\csc230\include130\iosfwd 77: Declaration
missing ;
 

{smallsort}

Re:Cannot compile with #include <iostream>

The error message shows this path to the header file:
c:\John\class\csc\csc230\include130\iosfwd
iosfwd.h is a header file supplied by the compiler but the error message you
show indicates that you are using a different header file of the same name,
one specific to you. Things are more likely to work better if the compiler
supplied header files not replaced by other files with the same names.
When you did the compiler installation did you create the bcc32.cfg and
ilink32.cfg configuration files in the compiler's BIN directory as it says
to do in the readme.txt file? If not, please create them now. The file
contents are shown below using the default installation path. If you used a
different path then substitute that path for what is shown below. Note that
the -I is a capital 'i' and not a lower case 'L'.
Contents of c:\borland\bcc55\bin\bcc32.cfg, 2 text lines
-Ic:\borland\bcc55\include
-Lc:\borland\bcc55\lib
Contents of c:\borland\bcc55\bin\ilink32.cfg, 1 text line
-Lc:\borland\bcc55\lib
Hopefully when the default path to the header files is specified in the
bcc32.cfg file it will cause the compiler supplied headers to be found
first.
. Ed
Quote
John wrote in message
news:40142a1d$ XXXX@XXXXX.COM ...

My mistake. These are the first few errors:

Error E2451 c:\John\class\csc\csc230\include130\iosfwd 68: Undefined
symbol 'mbstate_t'
Error E2299 c:\John\class\csc\csc230\include130\iosfwd 68: Cannot
generate template specialization from 'fpos<_St>'
Error E2040 c:\John\class\csc\csc230\include130\iosfwd 68: Declaration
terminated incorrectly
Error E2257 c:\John\class\csc\csc230\include130\iosfwd 69: , expected
Error E2139 c:\John\class\csc\csc230\include130\iosfwd 77: Declaration
missing ;
 

Re:Cannot compile with #include <iostream>

Ed Mulroy [TeamB] wrote:
Quote
The error message shows this path to the header file:
c:\John\class\csc\csc230\include130\iosfwd

iosfwd.h is a header file supplied by the compiler but the error message you
show indicates that you are using a different header file of the same name,
one specific to you. Things are more likely to work better if the compiler
supplied header files not replaced by other files with the same names.

When you did the compiler installation did you create the bcc32.cfg and
ilink32.cfg configuration files in the compiler's BIN directory as it says
to do in the readme.txt file? If not, please create them now. The file
contents are shown below using the default installation path. If you used a
different path then substitute that path for what is shown below. Note that
the -I is a capital 'i' and not a lower case 'L'.

Contents of c:\borland\bcc55\bin\bcc32.cfg, 2 text lines

-Ic:\borland\bcc55\include
-Lc:\borland\bcc55\lib

Contents of c:\borland\bcc55\bin\ilink32.cfg, 1 text line

-Lc:\borland\bcc55\lib

Hopefully when the default path to the header files is specified in the
bcc32.cfg file it will cause the compiler supplied headers to be found
first.

. Ed

I did set up the cfg files as the readme said, except I added a line
referencing another include folder that had .h files provided by my
instructor. When I switched machines, I wasn't very selective about wich
files I put there. When I narrowed it down to just those files that were
separate from Borlands included files, it compiled cleanly.
Thanks again Ed.