From my little knowledge in C/C++ I have a feeling the error messages I’m getting are to do with definition clashes between two or more libraries; namely Arduino.h and StandardCplusplus.h, in my case. Would anyone have answers to any of these questions?
Is my theory on the right track?
If so, is PlatformIO Library Manager not capable of detecting these clashes yet?
Is there a way I can fix this manually?
Here is the error message: In file included from src\safelock.cpp:1:0: .pioenvs\leonardo\StandardCplusplus_ID572/cstdlib:60:18: error: expected unqualified-id before 'long' inline long abs(long i){ ^ .pioenvs\leonardo\FrameworkArduino/Arduino.h:86:18: note: in definition of macro 'abs' #define abs(x) ((x)>0?(x):-(x)) ^ .pioenvs\leonardo\StandardCplusplus_ID572/cstdlib:60:18: error: expected ')' before 'long' inline long abs(long i){ ^ .pioenvs\leonardo\FrameworkArduino/Arduino.h:86:18: note: in definition of macro 'abs' #define abs(x) ((x)>0?(x):-(x)) ^ .pioenvs\leonardo\StandardCplusplus_ID572/cstdlib:60:18: error: expected ')' before 'long' inline long abs(long i){ ^ .pioenvs\leonardo\FrameworkArduino/Arduino.h:86:18: note: in definition of macro 'abs' #define abs(x) ((x)>0?(x):-(x)) ^
Sorry if this is the wrong place to go about asking, I’m hoping this will help anyone else with these problems!
Guys, we don’t have time to support this library. I see that the repo of the library is inactive. We propose someone to fork it and apply all PRs that still wait for that. Then we will transfer library.json to the new repo or you can use the current config https://raw.githubusercontent.com/ivankravets/StandardCplusplus/patch-1/library.json
I have just managed to use StandardCplusplus.h with Arduino.h together by applying a solution mentioned in one of the linked issues. Although the automatic compiler still says StandardCplusplus.h: No such file or directory, the following test program worked fine (using Arduino Leonardo):