This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

wstring and gcc


I'm running gcc 3.2 on a redhat linux box.

this simple code :
int main()
{
wstring foo;
printf("%s\n",foo.c_str());
return 0;
}

produces the following link error:
"
/tmp/cceNYHXk.o: In function `main':
/tmp/cceNYHXk.o(.text+0x18): undefined reference to
`std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::basic_string[in-charge]()'
/tmp/cceNYHXk.o(.text+0x23): undefined reference to
`std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::c_str() const'
/tmp/cceNYHXk.o(.text+0x3e): undefined reference to
`std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::~basic_string [in-charge]()'
/tmp/cceNYHXk.o(.text+0x51): undefined reference to
`std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::~basic_string [in-charge]()'
collect2: ld returned 1 exit status"

since gcc 3.2 is in my home directory, the command line to build the app is
as follows:
/home/andy/tools3.2/H-i686-pc-linux-gnu/bin/gcc -o tstapp test.cpp -static
-lstdc++

Any help in resolving this is greatly appreciated
Andy


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