Welcome! Log In Create A New Profile

Advanced

wstring

Posted by topfs2 
wstring
April 19, 2009 02:43PM
Hi, I'm trying out to create an application but having trouble compiling stuff with wstring.

To get std::string to work I took the template and moved it to cpp instead of c.
More or less just added #include

[pastebin.ca]

The std::string works but std:wstring fails to compile.

topfs@tobias:~/wii-dev/wii-examples/template$ make
template.cpp
/home/topfs/wii-dev/wii-examples/template/source/template.cpp: In function 'int main(int, char**)':
/home/topfs/wii-dev/wii-examples/template/source/template.cpp:58: error: 'wstring' is not a member of 'std'
/home/topfs/wii-dev/wii-examples/template/source/template.cpp:58: error: expected `;' before 's2'
make[1]: *** [template.o] Error 1
make: *** [build] Error 2
Re: wstring
April 25, 2009 09:10PM
This has been covered before, newlib doesn't have a full wstring implementation. You'll have to write your own, or rather, you can find the source and strip it out.

I'm not sure if newlib is using STLPort or if that's worthwhile looking into.
Re: wstring
April 26, 2009 03:28PM
Actually, I solved his trouble on IRC a few days ago.
typedef wstring basic_string;
Re: wstring
April 27, 2009 04:38AM
Ah, great! Thanks for posting it here too =)
Re: wstring
April 27, 2009 11:53AM
Yeah, if only the forum software hadn't eaten the mandatory special characters. Then I would actually have been useful.
Re: wstring
April 27, 2009 12:46PM
henke37++ :)
Re: wstring
August 04, 2009 04:49PM
I recently had the name problem and henke37's solution didn't work for me.

Using:
#define wstring basic_string
instead did work.

I just wanted to put that out there for anyone else who may be having trouble with this.
Re: wstring
August 05, 2009 01:26AM
As I said, the forum ate critical parts of the code.
typedef wstring basic_string lessthensign short greatherthansign;
Re: wstring
August 05, 2009 04:39PM
I will admit that I overlooked that.

Retrying with typedef and the correct version of your code produced the same errors again. Using #define instead worked perfectly and also took care of errors that I didn't even think were entirely related to wstring.

Thank you henke37 :)
Re: wstring
August 07, 2009 04:47PM
Well, it's obviously not in the std namespace, so stop using it like it is.
Sorry, only registered users may post in this forum.

Click here to login