wsprintf()
is a Windows-specific function, it's unavailable on Unixes. What you want to achieve can be done in a more portable way (I have tried this slightly modified code snippet and it worked as expected):
#include <wchar.h>
#include <stdio.h>
int main(int argc, char **argv)
{
wchar_t buf[16];
swprintf(buf, sizeof(buf) / sizeof(*buf), L"%d", 5);
wprintf(L"[%ls]\n", buf);
return 0;
}
Output:
[5]