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

Recommended Answers

All 2 Replies

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.