Hello fellas,

I have encountered a problem during the converting process.
Here below is my function to convert wchar_t * to char*

void wtoc(char* Dest,const wchar_t *Source)
{
int i = 0;

while(Source[i] != '\0')
{
Dest[i] = (char)Source[i];
++i;
}
}

it compiles succesfully however on linking phase, it gives out an error


undefined reference to `mynamespace::myfunc::wtoc(char*, wchar_t const*)'


and it is really confusing because I don't have a function with a prototype like that. my prototype is

void wtoc(char* Dest,const wchar_t *Source)

so what is wrong with me in here? And also can you suggest any alternative ways to convert wchar_t to char

Thanx in advance.
DK