EasyLogger and ArduinoJSON are butting heads

Hi - this is possibly a stupid question, sorry.

I’ve got code that runs well, VSCode and Platform were much easier to get going than CLion.

I have used EasyLogger for some time now, no issues so far.
I tried adding ArduinoJSON.

If either one is installed without the other, things are great.

If I install them both, I get an error about a particular line in the EasyLogger.h

.pio/libdeps/nodemcu-32s/EasyLogger/src/EasyLogger.h:13:18: 
error: expected unqualified-id before string constant
     #define endl "\r\n"

I am not sure at all how or why this is happening. Is it something like the JSON library trying to set a conflicting set for that or something… It also happens no matter the order I put the includes in.

Thanks!

EDIT: I did switch to ArduinoLogger and no errors, still really curious

I think the mystery is easy to solve :wink: - endl is part of the standard c++ iostream-library, which is used by ArduinoJson.

IMHO (re-)defining this identifier - like it’s obviously done in EasyLogger - seems not to be a good idea …

1 Like

Yeah, I found that in my attempts to sort it out, the endl thing… but I am really new to C++ and the implications were a bit beyond me. Switching loggers seems to be good.

EDIT: And thank you for the post and help!