The simple code below 

#include <wchar.h>

int main ()
{
  wchar_t wcs1[] = L"To be or not to be";
  wchar_t wcs2[40];

  wcsncpy ( wcs2, wcs1, 40 );
  wprintf (L"%ls\n%ls\n",wcs1,wcs2);

  return 0;
}

gives link time error : 

 gcc hello.c
/tmp/ccoiOZyQ.o:hello.c:(.text+0x5e): undefined reference to `_wcsncpy'
collect2: ld returned 1 exit status


Is there any way around for me ?  Even I think this is a problem with MSYS special gcc I downloaded all dev packages with mingw installiton manager and also updated the existing ones. 

I need _wsnncpy because I need to compile python. Python nags about wide char related functions like _wcsncpy. I need python badly because I need to recompile gdb with python option on my windows machine with help of MSYS.

And advise or help will be appriciated . 

Regards
Erdem

Note: gcc options&version  
$ gcc -v
Reading specs from /usr/lib/gcc/i686-pc-msys/3.4.4/specs
Configured with: /home/cstrauss/build/gcc3/gcc-3.4.4/configure --prefix=/usr --s
ysconfdir=/etc --localstatedir=/var --infodir=/share/info --mandir=/share/man --
libexecdir=/lib --enable-languages=c,c++ --disable-nls --enable-threads=posix --
enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debug --
with-newlib
Thread model: posix
gcc version 3.4.4 (msys special)