Kevin Alden

rtcs fails to build

Discussion created by Kevin Alden on Jun 16, 2015
Latest reply on Jun 23, 2015 by Kevin Alden

I am using GCC 4.9 and KSDK 1.2.0.  RTCS fails to build with the following error:

 

KSDK_1.2.0/middleware/tcpip/rtcs/source/if/getaddrinfo.c:75:15: error: static declaration of 'strdup' follows non-static declaration

static char * strdup( const char *s);

               ^

In file included from gcc/4.9/gcc-arm-none-eabi/gcc-arm-none-eabi-4_9-2014q4/arm-none-eabi/include/string.h:10:0,

                 from KSDK_1.2.0/middleware/tcpip/rtcs/source/if/getaddrinfo.c:48:

gcc/4.9/gcc-arm-none-eabi/gcc-arm-none-eabi-4_9-2014q4/arm-none-eabi/include/string.h:80:8: note: previous declaration of 'strdup' was here

char  *_EXFUN(strdup,(const char *));

        ^

 

 

I'm not sure why Freescale chose to reuse the strdup name from the standard library, but newer versions of gcc don't like it.  For now I have patched getaddrinfo.c to rename strdup to strdup2.  This resolved my build issues.

Outcomes