<fstream.h> and <fstream> chaos 
Author Message
 <fstream.h> and <fstream> chaos

Hi there,

I want to combine several projects (one app + several libs). In some
(older) libs I use <fstream.h>
in the newer ones I use the STL <fstream>.

Each lib can be compiled separatly.

If I try to compile my app I get:
..\fstream(82) : error C2039: 'openmode' : is not a member of 'ios'
..\fstream(82) : error C2065: 'openmode' : undeclared identifier
..\fstream(82) : error C2146: syntax error : missing ')' before
identifier '_M'
..\fstream(82) : error C2561: 'open' : function must return a value

I've checked my code and I DO NOT use namespace. Instead I use
std::fstream for STL and ::fstream for non-STL. This should be
unambiguos!

Have I overseen something important ?

I'm using VC++ 5.0.

Thanks!
Jorge



Mon, 27 Mar 2000 03:00:00 GMT  
 <fstream.h> and <fstream> chaos

What you have overlooked is that you cannot use both the iostream .h-less
files and .h-full file in the same application.  The .h-full header files
are for backward compatibility only and are incompatible with the standard
library headers.  I have no ready workaround except to use the c
pre-processor to conditionalize which includes I use depending on the
platform.

This is documented somewhere in the online docs.



Quote:
> Hi there,

> I want to combine several projects (one app + several libs). In some
> (older) libs I use <fstream.h>
> in the newer ones I use the STL <fstream>.

> Each lib can be compiled separatly.

> If I try to compile my app I get:
> ..\fstream(82) : error C2039: 'openmode' : is not a member of 'ios'
> ..\fstream(82) : error C2065: 'openmode' : undeclared identifier
> ..\fstream(82) : error C2146: syntax error : missing ')' before
> identifier '_M'
> ..\fstream(82) : error C2561: 'open' : function must return a value

> I've checked my code and I DO NOT use namespace. Instead I use
> std::fstream for STL and ::fstream for non-STL. This should be
> unambiguos!

> Have I overseen something important ?

> I'm using VC++ 5.0.

> Thanks!
> Jorge



Mon, 27 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. <<<<<<<Parsing help, please>>>>>>>>

2. File Format conversion, ascii freeform -->.csv <-->.wk1<-->dbf<-->?HELP

3. <<<>>>Need C code advice with functions and sorting.<<<>>>

4. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

5. pb with replacing <fstream.h> by <fstream>

6. <fstream.h> or <fstream>

7. #include <fstream> or <fstream.h>?

8. <fstream> vs <fstream.h>

9. >>>Windows Service<<<

10. <fstream>

11. <fstream> and file sharing

12. proposal: <basic.h>, <pascal.h>, <fortran.h>, <cobol.h>

 

 
Powered by phpBB® Forum Software