Freescale USB Stack and C++

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

Freescale USB Stack and C++

ソリューションへジャンプ
1,886件の閲覧回数
weblar
Contributor V

Hi,

I have a C++ application in which I'd like to use the Freescale USB stack, specifically the MSD class.

From previous experience, I've had to decorate my C prototypes with extern "C" in order for them to work in C++, due to the way the linker works.

Will I have to do exactly the same with all routines that make up the USB stack?

Thanks,

Kev

ラベル(2)
タグ(3)
0 件の賞賛
返信
1 解決策
1,648件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hello,

with 'extern "C"' you need to mark interfaces you are calling from C++. So whatever you have compiled in C mode, and gets called by C++ code, needs to be marked with that extern "C".

As for the MSD stack, this would only apply to a few routines, I guess. It just depends how you structure your application and the interface to the stack.

Hope this helps,

Erich

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,649件の閲覧回数
BlackNight
NXP Employee
NXP Employee

Hello,

with 'extern "C"' you need to mark interfaces you are calling from C++. So whatever you have compiled in C mode, and gets called by C++ code, needs to be marked with that extern "C".

As for the MSD stack, this would only apply to a few routines, I guess. It just depends how you structure your application and the interface to the stack.

Hope this helps,

Erich

0 件の賞賛
返信
1,648件の閲覧回数
weblar
Contributor V

Thanks for your reply.

I've done as you've mentioned and this works perfectly.

Thanks,

Kev

0 件の賞賛
返信