This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problems with std::wstring on Solaris

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
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. :(


Join the world’s largest e-mail service with MSN Hotmail.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]