XInput recipe.preproc.macros is missing leonardo

Hi, I'm trying to emulate an xbox controller on an arduino leonardo using the xinput library. However, the library requires you to use a custom board name in the IDE for anything other than a debug. When I try to upload or compile the code, I get this error: recipe.preproc.macros pattern is missing
Error compiling for board Arduino Leonardo w/ XInput. Any idea on what I should do? Code is down below.


#include <XInput.h>

void setup() {
XInput.begin();
XInput.setJoystickRange(0,1023);}

void loop() {
XInput.setJoystick(JOY_LEFT, analogRead(0),analogRead(1));
}

Welcome to the forum

Have you searched the forum for recipe.preproc.macros

Only issues with other microcontrollers show up.

Please post the link to the instructions you followed for doing that.

How to Emulate an Xbox Controller with Arduino (XInput) - Parts Not Included

I was not able to reproduce the error and I see that the "XInput AVR Boards" boards platform does indeed define a recipe.preproc.macros property:

So I can only suggest that you uninstall the "XInput AVR Boards" boards platform and then install it again in case you messed it up in some way on the first attempt.

Issue solved, thanks for your help. To fix this issue, move the contents of the AVR folder to its xinput parent folder.

Which version of the Arduino IDE are you using?