0

hi all
this is the code in question

namespace std
{
    typedef std::basic_string<wchar_t> wstring;
};
#endif

#if defined(__HAIKU__)
namespace std {
    class wstring : public std::basic_string<char>
    {
    public:
        wstring(const char *t)
            : std::basic_string<char>(t)
        {
        }
        wstring()
        {
        }
        wstring(const wstring &that)
            : std::basic_string<char>(that.c_str())
        {
        }
        wstring(const std::basic_string<char> &that)
            : std::basic_string<char>(that)
        {
        }
    };
};
#endif

and hereIn file included from curl_adapter.cpp:30:0:
utility.h:66:8: error: using typedef-name 'std::wstring' after 'class'
/boot/develop/abi/x86/gcc4/tools/gcc-4.6.2-haiku-120121/lib/gcc/i586-pc-haiku/4.6.2/../../../../include/c++/4.6.2/bits/stringfwd.h:70:33: error: 'std::wstring' has a previous declaration here
In file included from GC.cpp:24:0:
utility.h:66:8: error: using typedef-name 'std::wstring' after 'class'
/boot/develop/abi/x86/gcc4/tools/gcc-4.6.2-haiku-120121/lib/gcc/i586-pc-haiku/4.6.2/../../../../include/c++/4.6.2/bits/stringfwd.h:70:33: error: 'std::wstring' has a previous declaration here
make[2]: *** [libgnashbase_la-GC.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [libgnashbase_la-curl_adapter.lo] Error 1
make[2]: Leaving directory /boot/home/Desktop/gnash-0.8.10/libbase' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/boot/home/Desktop/gnash-0.8.10'
make: *** [all] Error 2
~/Desktop/gnash-0.8.10>
is the error

2
Contributors
2
Replies
4
Views
4 Years
Discussion Span
Last Post by khallebal
0

line 3 is wrong because std::wstring is declared in <string> header file If you want your own class then put it in a different namespace.

Edited by Ancient Dragon

0

thanks alot for replying,
it seems easy, but what can i change in line 3 to get this code compile?
sorry,i'm relly a newbi.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.