wcout' is not a member of `std'

Discussion in 'C++' started by jalkadir, Oct 7, 2005.

  1. jalkadir

    jalkadir Guest

    WinXP P3 MinWing-GCC-3.4.3
    When compiling the program below, I get a message that reads:

    wcout' is not a member of `std'

    What am I doing wrong?
    This message popping up too often!! :mad:

    TIA


    #include <cstdlib>
    #include <iostream>
    #include <wchar.h>
    #include <vector>

    using namespace std;
    // This C function is the combined effort of the folks from
    // comp.lang.c++
    // Special thanks to John Harrison for his outstnding
    // partisipation

    std::wstring ctow(const char* src){
    std::vector<wchar_t> dest(CHAR_MAX);
    int i = mbstowcs(&dest[0], src, strlen(src));
    return std::wstring(&dest[0]);
    }
    int main(int argc, char *argv[])
    {
    const char* str = "hola";
    std::wstring wstr;
    wstr = ctow(str);

    std::wcout << wstr ;

    std::cout << std::endl;

    system("PAUSE");
    return EXIT_SUCCESS;
    }
     
    jalkadir, Oct 7, 2005
    #1
    1. Advertising

  2. jalkadir

    Rolf Magnus Guest

    jalkadir wrote:

    > WinXP P3 MinWing-GCC-3.4.3


    What is MinWing? You mean MingW?

    > When compiling the program below, I get a message that reads:
    >
    > wcout' is not a member of `std'
    >
    > What am I doing wrong?
    > This message popping up too often!! :mad:


    Compiles fine with GCC 3.3.4 and 3.4.4 under Linux here.
     
    Rolf Magnus, Oct 7, 2005
    #2
    1. Advertising

  3. jalkadir

    jalkadir Guest

    Thanks for the help, and for putting up with my shortcomings. <:(
    I will dig a bit more in this matter.

    At least I know the code works, perhaps there is a problem with the
    MingW implementation of GCC.
    Again, thanks.
     
    jalkadir, Oct 7, 2005
    #3
  4. jalkadir

    jalkadir Guest

    jalkadir, Oct 7, 2005
    #4
  5. * jalkadir:
    > WinXP P3 MinWing-GCC-3.4.3
    > When compiling the program below, I get a message that reads:
    >
    > wcout' is not a member of `std'
    >
    > What am I doing wrong?
    > This message popping up too often!! :mad:


    You're not doing anything wrong. That compiler+library simply doesn't have
    std::wcout.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Oct 7, 2005
    #5
  6. jalkadir

    jalkadir Guest

    Thanks for your reply!!
    Yes, this is really terrible, I counting cigwin or MingW for this work,
    but apparently BCC55 has the same problem, is there around this
    problem?

    TIA
     
    jalkadir, Oct 9, 2005
    #6
  7. jalkadir

    P.J. Plauger Guest

    "jalkadir" <> wrote in message
    news:...

    > Thanks for your reply!!
    > Yes, this is really terrible, I counting cigwin or MingW for this work,
    > but apparently BCC55 has the same problem, is there around this
    > problem?


    If you're willing to pay money, there is.

    P.J. Plauger
    Dinkumware, Ltd.
    http://www.dinkumware.com
     
    P.J. Plauger, Oct 9, 2005
    #7
  8. "jalkadir" <> writes:

    > Thanks for your reply!!
    > Yes, this is really terrible, I counting cigwin or MingW for this work,
    > but apparently BCC55 has the same problem, is there around this
    > problem?
    >
    > TIA


    You could try STLPort.
    Regards, kga
     
    Klaus-Georg Adams, Oct 10, 2005
    #8
    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. iwongu
    Replies:
    1
    Views:
    371
    Victor Bazarov
    Dec 14, 2006
  2. Ralf Goertz

    mixing of std::cout and std::wcout

    Ralf Goertz, Jul 4, 2007, in forum: C++
    Replies:
    2
    Views:
    438
    Ralf Goertz
    Jul 6, 2007
  3. Replies:
    2
    Views:
    484
  4. Erik Knudsen

    std::wcout and const char *

    Erik Knudsen, Dec 11, 2007, in forum: C++
    Replies:
    10
    Views:
    678
    Erik Knudsen
    Dec 14, 2007
  5. Amit Kumar

    Is std::wcout really required?

    Amit Kumar, Jun 27, 2009, in forum: C++
    Replies:
    8
    Views:
    3,255
    Alf P. Steinbach
    Jun 29, 2009
Loading...

Share This Page