extern "C" linkage for KSDK headers

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

extern "C" linkage for KSDK headers

516件の閲覧回数
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 返信

341件の閲覧回数
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 件の賞賛