Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

identifier "__locale_t" is undefined

erling_andersen
New Contributor I
1,020 Views
I just upgraded our Intel C to
composer_xe_2011_sp1.8.273
but now gets errors as shown below. Any suggestions?
/remote/public/linux/opt/intel/composer_xe_2011_sp1.8.273/bin/intel64/icc
-gcc-name=/remote/public/linux/64-x86/gcc/4.6.0/bin/gcc -gcc-version=460 [A lot stuff deleted.]
src/cpub/countcpu.c/usr/include/string.h(546): error: identifier "__locale_t" is undefined __locale_t __loc) ^
/usr/include/string.h(547): error: attribute "nonnull" references nonpointer parameter __THROW __attribute_pure__ __nonnull ((1, 2, 3)); ^
/usr/include/string.h(550): error: identifier "__locale_t" is undefined size_t __n, __locale_t __loc) ^
/usr/include/string.h(551): error: attribute "nonnull" references nonpointer parameter __THROW __attribute_pure__ __nonnull ((1, 2, 4));
0 Kudos
5 Replies
SergeyKostrov
Valued Contributor II
1,020 Views
...Any suggestions?...
src/cpub/countcpu.c/usr/include/string.h(546): error: identifier "__locale_t" is undefined __locale_t __loc)


It looks like some headers are not included. My version of 'string.h' doesn't have any references to '_locale_t'.

0 Kudos
erling_andersen
New Contributor I
1,020 Views
I think those definitions are in an include file.
Some more information. On another system it works. I have included some information about the diference in string.h file for those 2 systems.
Good system:
#ifdef __USE_GNU
/* The following functions are equivalent to the both above but they
take the locale they use for the collation as an extra argument.
This is not standardsized but something like will come. */
# include
/* Compare the collated forms of S1 and S2 using rules from L. */
extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
__THROW __attribute_pure__ __nonnull ((1, 2, 3));
/* Put a transformation of SRC into no more than N bytes of DEST. */
extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
__locale_t __l) __THROW __nonnull ((2, 4));
#endif
Bad system:
#ifdef __USE_XOPEN2K8
/* The following functions are equivalent to the both above but they
take the locale they use for the collation as an extra argument.
This is not standardsized but something like will come. */
# include
/* Compare the collated forms of S1 and S2 using rules from L. */
extern int strcoll_l (__const char *__s1, __const char *__s2, __locale_t __l)
__THROW __attribute_pure__ __nonnull ((1, 2, 3));
/* Put a transformation of SRC into no more than N bytes of DEST. */
extern size_t strxfrm_l (char *__dest, __const char *__src, size_t __n,
__locale_t __l) __THROW __nonnull ((2, 4));
#endif
/* Return a malloc'd copy of at most N bytes of STRING. The
resultant string is terminated even if no null terminator
appears before STRING. */
#if defined __USE_XOPEN2K8
extern char *strndup (__const char *__string, size_t __n)
__THROW __attribute_malloc__ __nonnull ((1));
#endif
0 Kudos
erling_andersen
New Contributor I
1,020 Views
I do not have the problem on CentOS 5.6 but the problem is on CentOS 6.2.
So the issue seems to be related to version of the OS and hence to the installed include files.
0 Kudos
erling_andersen
New Contributor I
1,020 Views
FYI.
We build the gcc compiler ourself. It seems if GCC is build on old platform without Posix 2008 support then things does not work.
We now rebuild gcc on a newer system and it works then.
0 Kudos
JenniferJ
Moderator
1,020 Views
Thank you for posting the reason and solution here.

Jennifer
0 Kudos
Reply