rtcs fails to build

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

rtcs fails to build

658 Views
kalden_srcinc
Contributor IV

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.

Labels (1)
0 Kudos
2 Replies

431 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Kevin,

thank you very much for sharing your inputs. I will provide feedback to RTCS development team.

Best regards,

Carlos

0 Kudos

431 Views
kalden_srcinc
Contributor IV

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.

0 Kudos