DEFAULT_ADDRESS redefined - conflicting #define values for it is different Qwiic libraries

I am trying to use the LSM6DSO Qwiic board at the same time as the Button boards.

Both .h files define the #define DEFAULT_ADDRESS xx for their respective sensors

At compile time, I am getting an error that the #define DEFAULT_ADDRESS has been redefined

Is there a best way to fix this - I realize I could edit the library files and create a new #define that is unique for each, but would like to know if there is an easier way.

Thanks

It is probably just a warning, so you could ignore it. Assuming you don’t need one of the defines in your code, you could also do

#include <first_header.h>
#undef DEFAULT_ADDRESS
#include <second_header.h>

Excellent suggestion - that eliminated the error.

The other error I had was that the Button library automatically included Registers.h

Once I commented that out, the duplicate enum definitions etc disappeared. That library file should likely have a #ifndef at the beginning to eliminate those duplicate definitions