I am a relatively novice programmer working with icc v7 under RedHat Linux 8.0. When compiling code using the "swprintf" function, the compiler tells me that swprintf is undefined. Am I missing a particular header file? In the /usr/include directory, wchar.h appears to define this function but, even when I include this file and use -I/usr/include when compiling, icc still reports that swprintf is undefined . . .

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Declaration (prototype) for swprintf is included in a program only if __USE_ISOC99 macro is defined - refer to wchar.h or cwchar header files.

This macro is defined, in /usr/include/features.h, iff _GNU_SOURCE macro is defined.

In summary, define this macro, -D_GNU_SOURCE=1, on command line to include swprintf decl.


Leave a Comment

Please sign in to add a comment. Not a member? Join today