works fine using gcc

Discussion in 'C++' started by deodiaus, Jan 21, 2004.

  1. deodiaus

    deodiaus Guest

    In my program I
    #include <ostream>
    #include <iostream>//cout
    #include <strstream>
    ---------------------------------
    I am using vcdev 6 and getting the following error
    c:\program files\microsoft visual studio\vc98\include\strstream(87)
    'ostream' : base class undefined


    any ideas why??
    Could it be that I might have a
    #include <fstream.h>
    somewhere
    which is obsolete,and had a warning from gcc?
    deodiaus, Jan 21, 2004
    #1
    1. Advertising

  2. "deodiaus" <> wrote...
    > In my program I
    > #include <ostream>
    > #include <iostream>//cout
    > #include <strstream>
    > ---------------------------------
    > I am using vcdev 6 and getting the following error
    > c:\program files\microsoft visual studio\vc98\include\strstream(87)
    > 'ostream' : base class undefined
    >
    >
    > any ideas why??
    > Could it be that I might have a
    > #include <fstream.h>
    > somewhere
    > which is obsolete,and had a warning from gcc?


    Perhaps you need to bring 'ostream' name to the global namespace
    before including the old header <strstream>. Otherwise, try to
    use <sstream>, it's newer and therefore better.

    Victor
    Victor Bazarov, Jan 21, 2004
    #2
    1. Advertising

  3. On Wed, 21 Jan 2004 13:37:22 -0800, deodiaus wrote:

    > In my program I
    > #include <ostream>
    > #include <iostream>//cout
    > #include <strstream>
    > ---------------------------------
    > I am using vcdev 6 and getting the following error
    > c:\program files\microsoft visual studio\vc98\include\strstream(87)
    > 'ostream' : base class undefined
    >
    >
    > any ideas why??
    > Could it be that I might have a
    > #include <fstream.h>
    > somewhere
    > which is obsolete,and had a warning from gcc?


    Yes, this is your problem. Some versions of MSVC have big problems mixing
    old and new streams. It is a bad idea anyhow, so don't do that(tm).

    HTH,
    M4
    Martijn Lievaart, Jan 22, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Derrick
    Replies:
    2
    Views:
    1,569
    Kevin Spencer
    Aug 26, 2004
  2. WTH
    Replies:
    1
    Views:
    334
    Rick Strahl [MVP]
    Nov 2, 2004
  3. no-spamJim

    aspx gives dns error, html works fine

    no-spamJim, Apr 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,156
    no-spamJim
    Apr 6, 2005
  4. Adam P
    Replies:
    0
    Views:
    468
    Adam P
    Sep 27, 2005
  5. guy
    Replies:
    2
    Views:
    424
    Aaron Bertrand [MVP]
    Feb 23, 2004
Loading...

Share This Page