Connecting Tech Pros Worldwide Forums | Help | Site Map

wcout' is not a member of `std'

jalkadir
Guest
 
Posts: n/a
#1: Oct 7 '05
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!! >:(

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;
}


Rolf Magnus
Guest
 
Posts: n/a
#2: Oct 7 '05

re: wcout' is not a member of `std'


jalkadir wrote:
[color=blue]
> WinXP P3 MinWing-GCC-3.4.3[/color]

What is MinWing? You mean MingW?
[color=blue]
> 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!! >:([/color]

Compiles fine with GCC 3.3.4 and 3.4.4 under Linux here.

jalkadir
Guest
 
Posts: n/a
#3: Oct 7 '05

re: wcout' is not a member of `std'


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
Guest
 
Posts: n/a
#4: Oct 7 '05

re: wcout' is not a member of `std'


Yes, I was right. I am not the only one having this problem.
There at least one more programmer with this problem: see
http://groups.google.ca/group/comp.l...2da18abd63381b

How about Borland C/C++ compiler, does it support wstrings?

TIA

Alf P. Steinbach
Guest
 
Posts: n/a
#5: Oct 7 '05

re: wcout' is not a member of `std'


* jalkadir:[color=blue]
> 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!! >:([/color]

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?
jalkadir
Guest
 
Posts: n/a
#6: Oct 9 '05

re: wcout' is not a member of `std'


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

P.J. Plauger
Guest
 
Posts: n/a
#7: Oct 9 '05

re: wcout' is not a member of `std'


"jalkadir" <jalkadir@gosonic.ca> wrote in message
news:1128823090.051513.102710@o13g2000cwo.googlegr oups.com...
[color=blue]
> 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?[/color]

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

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com


Klaus-Georg Adams
Guest
 
Posts: n/a
#8: Oct 10 '05

re: wcout' is not a member of `std'


"jalkadir" <jalkadir@gosonic.ca> writes:
[color=blue]
> 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[/color]

You could try STLPort.
Regards, kga
Closed Thread