rtcs fails to build

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

rtcs fails to build

1,315 次查看
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.

标签 (1)
0 项奖励
回复
2 回复数

1,088 次查看
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 项奖励
回复

1,088 次查看
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 项奖励
回复