Hello, I have a problem with compiling my code...
Platform: Ubuntu Linux 10.04
Compiler: gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
IDE: Netbeans 6.9.1
My C program is required to exclusively deal with Unicode. I can use these functions just fine: wcscpy(), wcslen(), mbstowcs(), wcstombs(), snprintf()
The problem seems to only be when I use this function: swprintf()
Here are the headers I am including in the order I am including them:
#include <stdlib.h> #include <string.h> #include <math.h> #include <stdio.h> #include <wchar.h> #include <wctype.h>
This is the line of code which gives me an error:
ret = __builtin_apply( (void *)swprintf, args, 1024 );
This is the error I get. Its the only error I get:
456: error: ‘swprintf’ undeclared (first use in this function) 456: error: (Each undeclared identifier is reported only once 456: error: for each function it appears in.)
In the NetBeans IDE, I right click the function name "swprintf" and click "Navigate / Go to Definition". It takes me to line 602 of "wchar.h":
/* Write formatted output of at most N characters to S. */ extern int swprintf (wchar_t *__restrict __s, size_t __n, __const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
So curiously enough, NetBeans can see it just fine. Why can't gcc? Remember, all the other wchar_t functions did not have any compiler errors. Also keep in mind that this is not a linker error.