extern "C" linkage for KSDK headers

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

extern "C" linkage for KSDK headers

740 次查看
maxv
Contributor I

Could someone working on the next version of the Kinetis Connectivity Software SDK make sure that all of the headers are conditionally-wrapped for C linkage?

 

#ifdef __cplusplus
extern "C" {
#endif

...

#ifdef __cplusplus
}
#endif

 

This isn't currently the case with most of the headers from the v1.0.2 Connectivity Software SDK.

Not exposing using C linkage leads to the usual errors when called from C++ files:

 

./source/Coordinator.o: In function `MLME_NWK_SapHandler(nwkMessage_tag*, unsigned long)':
/../source/Coordinator.cpp:929: undefined reference to `ListAddTailMsg(list_tag*, void*)'
./source/Coordinator.o: In function `MCPS_NWK_SapHandler(mcpsToNwkMessage_tag*, unsigned long)':
/../source/Coordinator.cpp:937: undefined reference to `ListAddTailMsg(list_tag*, void*)'
./source/Coordinator.o: In function `App_init':
/../source/Coordinator.cpp:964: undefined reference to `ListInit(list_tag*, unsigned long)'
/../source/Coordinator.cpp:965: undefined reference to `ListInit(list_tag*, unsigned long)'
/../source/Coordinator.cpp:968: undefined reference to `Mac_SetExtendedAddress(unsigned char*, unsigned long)'
./source/Coordinator.o: In function `AppThread(void*)':
/../source/Coordinator.cpp:1017: undefined reference to `ListRemoveHeadMsg(list_tag*)'
/../source/Coordinator.cpp:1150: undefined reference to `ListRemoveHeadMsg(list_tag*)'
./source/Coordinator.o: In function `coordinator_main_task':
/../source/Coordinator.cpp:1203: undefined reference to `TMR_Init()'
/../source/Coordinator.cpp:1205: undefined reference to `SecLib_Init()'
/../source/Coordinator.cpp:1208: undefined reference to `RNG_Init()'

 

I've added this wrapping to copies of the headers in my project (cloned with the Project Cloner), but it would be great to see this upstream.

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

565 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Max,

I will report the bug to SDK development team so that they can have a check.

Thank you for pointing out the issue.

BR

Xiangjun rong

0 项奖励
回复