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.
Hi Kevin,
thank you very much for sharing your inputs. I will provide feedback to RTCS development team.
Best regards,
Carlos
Found another thing. You use "private" as a variable name in ENET_open (fsl_enet_rtcs_adapter.h). This is a keyword in c++ so any c++ files including that will not compile. Renaming that variable in the header file resolves the issue.