6 years, 1 month ago.

Compile error when importing USBKeyboard.h

Hey,

I've been trying to make my ST-Nucleo-F303K8 into a HID keyboard. This seems like an incredibly easy task thanks to mbed! I've been following https://os.mbed.com/handbook/USBKeyboard and https://www.hackerspace-ntnu.no/wiki/tutorials/mbed/mbed-keyboard-en/ - my entire main.cpp is:

main.cpp

#include "mbed.h"
#include "USBKeyboard.h"

USBKeyboard keyboard;

int main(void) {

    while (1) {
        wait(1);
        keyboard.printf("Test");
    }
}

Problem is, it seems whenever I link against the USBDevice library I get

Console

Error: Identifier "PCD_HandleTypeDef" is undefined in "USBDevice/USBDevice/USBHAL.h", Line: 134, Col: 6

It seems something is missing in the USBDevice library? Do I need to include something else too?

Cheers

1 Answer

6 years, 1 month ago.

Hi Max,

Please see my answer on your question here: https://stackoverflow.com/questions/52828259/mbed-compiling-with-usbdevice-library-results-in-error

Please let me know if you have any questions!

- Jenny, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

Accepted Answer