problems with std::wstring on Solaris

Anthony Feick afeick@hotmail.com
Wed Aug 21 09:06:00 GMT 2002


When I do a simple test like this, it will compile okay, but not link.

#include <string>
#include <cwchar>

int main(void)
{
        std::string str;
        std::wstring wstr;
        return 0;
}


$ g++ test.cpp
/var/tmp//ccNdHTuR.o: In function `main':
/var/tmp//ccNdHTuR.o(.text+0xf4): undefined reference to 
`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocato
r<wchar_t> >::basic_string[in-charge]()'
/var/tmp//ccNdHTuR.o(.text+0x100): undefined reference to 
`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocat
or<wchar_t> >::~basic_string [in-charge]()'
collect2: ld returned 1 exit status

"std:string" works, but "std::wstring" and "std::basic_string<wchar_t>" 
don't link.


$ gcc -v
Reading specs from 
/users/afeick/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs
Configured with: ../gcc-3.2/configure --prefix=/users/afeick/local 
--enable-threads=posix --enable-shared --enable-cxx-flags=
-fshort-wchar --disable-multilib --disable-nls --with-gnu-ld 
--with-ld=/users/afeick/local/bin/ld --with-gnu-as --with-as=/us
ers/afeick/local/bin/as
Thread model: posix
gcc version 3.2



It seems like I'm having endless problems getting gcc 3.2 to work.  It must 
be something I'm doing wrong, because most people don't seem to be having as 
much trouble as I am. :(

-Tony


_________________________________________________________________
Join the worldÂ’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com



More information about the Libstdc++ mailing list