wcout' is not a member of `std'

J

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:

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

Rolf Magnus

jalkadir said:
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.
 
J

jalkadir

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.
 
A

Alf P. Steinbach

* 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.
 
J

jalkadir

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
 
K

Klaus-Georg Adams

jalkadir said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top