Unable to include EventQueue in Mbed 6 program

I’m using mbed-tools (Mbed CLI 2) and Mbed OS 6 and I’m trying to use an EventQueue. The program was generated with mbed-tools new my-program.
By simply declaring an event queue object EventQueue queue; I get the following error:
…/…/…/…/main.cpp:7:1: error: ‘EventQueue’ does not name a type
** 7 | EventQueue queue;**
** | ^~~~~~~~~~**
I’ve tried lots of different ways to include EventQueue like #include “EventQueue.h”, #include “mbed_events.h”, #include “events/EventQueue.h”, etc and nothing works.

How am I supposed to include the EventQueue library?

Thank you.


You can probably need to add mbed-events in your CMakeLists.exe file like below: