Workbench doesn't compile my code (but cloud does)


I started working with Workbench.

But it won’t compile my code.

The code compiles in the cloud.

Can someone see something from the error message?


In file included from ./inc/Arduino.h:26,
                 from /Users/vr/Documents/TomatoTent//src/tent.h:5,
                 from /Users/vr/Documents/TomatoTent//src/api_server.cpp:6:
/Users/vr/Documents/TomatoTent/lib/ArduinoJson/src/ArduinoJson/Polyfills/pgmspace_generic.hpp: In instantiation of 'typename ArduinoJson6194_F1::enable_if<ArduinoJson6194_F1::is_pointer<T>::value, T>::type ArduinoJson6194_F1::pgm_read(const void*) [with T = const __FlashStringHelper*; typename ArduinoJson6194_F1::enable_if<ArduinoJson6194_F1::is_pointer<T>::value, T>::type = const __FlashStringHelper*]':
/Users/vr/Documents/TomatoTent/lib/ArduinoJson/src/ArduinoJson/Deserialization/DeserializationError.hpp:85:12:   required from here
../wiring/inc/avr/pgmspace.h:148:29: error: 'const void*' is not a pointer-to-object type
  148 | #define pgm_read_ptr(addr) (*(const void *)(addr))
      |                            ~^~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [../build/target/user/platform-8-m/TomatoTent/src/api_server.o] Error 1
make[2]: *** [user] Error 2
make[1]: *** [/Users/vr/.particle/toolchains/deviceOS/3.3.0/modules/photon/user-part/makefile] Error 2
make: *** [compile-all] Error 2
The terminal process "/bin/bash '-c', 'make -f '/Users/vr/.particle/toolchains/buildscripts/1.10.0/Makefile' compile-all -s'" terminated with exit code: 2.

Press any key to close the terminal.

How do you cloud compile? (Web IDE, CLI, Workbench)

Does your cloud compile also target device OS v3.3.0?
Later device OSs often impose stricter compiler rules than older ones.
If you were using CLI or Web ID you may be targeting a more forgiving version.
Especially when using CLI without the --target switch it will default to the latest LTS version (currently 2.3.0).

To assess the exact cause for the error we’d also need to know where and how the pgm_read_ptr() macro is used in your code.
The issue is that this macro tries to dereference a pointer but no-one knows into what.

I’m using the CLI

my cloud targeted 2.2.0.

I changed my Bench to 2.2.0 but still same.

It seems the error came from ArduinoJSON

This fixed it:

Thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.