Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 1 month ago.
USBHost library not building
Hello,
I am using MBED OS 5 and i am adding USBHost library to my project. I cant get it to compile straight away, i had to remove the rtos and the fatfilesystem directories because mbed alread has them. I get these warnings: .././USBHost/USBHost/USBEndpoint.h:92:13: warning: 'void mbed::Callback<R()>::attach(U*, R (T::*)()) [with T = USBHostKeyboard; U = USBHostKeyboard; R = void]' is deprecated (declared at .././mbed-os/platform/Callback.h:297): Replaced by simple assignment 'Callback cb = func [since mbed-os-5.4] [-Wdeprecated-declarations] rx.attach(tptr, mptr);
Any body has a solution for this ?
Thanks
1 Answer
8 years ago.
You don't even need to add the USBHost library to your project, it's actually in Mbed OS: https://github.com/ARMmbed/mbed-os/tree/master/features/unsupported/USBHost
The warning can be fixed by changing line 92 to:
rx.attach(callback(tptr, mptr);
But it's a warning, so shouldn't affect your program.