Skip to content

ArduinoStringAdapter.hpp:7:10: fatal error: WString.h: No such file or directory #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
youcangetme opened this issue Sep 16, 2020 · 5 comments
Labels

Comments

@youcangetme
Copy link

I am compiling for the new Teknic ClearCore using the Arduino wrappers and the Arduino IDE. It is pretty spot of Arduino compatible with a few exceptions. The architecture is described as "32-bit ARM Cortex M4F processor operating at 120MHz with 512kB FLASH and 192kB RAM. DSP and floating point instruction sets."

Here is the error I get

In file included from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Strings/StringAdapters.hpp:16:0, from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Misc/SerializedValue.hpp:7, from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Variant/VariantData.hpp:8, from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Variant/SlotFunctions.hpp:8, from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Array/ArrayIterator.hpp:7, from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Array/ArrayRef.hpp:8, from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.hpp:17, from C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson.h:9, from C:\Users\youca\AppData\Local\Temp\arduino_modified_sketch_599557\JsonConfigFile.ino:22: C:\Users\youca\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Strings/ArduinoStringAdapter.hpp:7:10: fatal error: WString.h: No such file or directory #include <WString.h> ^~~~~~~~~~~ compilation terminated. exit status 1 Error compiling for board Teknic ClearCore.

I tried the usual workaround and included said libs directly in the same folder with no luck. This is just including the ArduinoJson.h so if I take it out all of these errors disappear.

I am sure this is pilot error and if somebody could give me direction as to what I am doing wrong it would be great. Thanks!

@bblanchon
Copy link
Owner

Hi @youcangetme,

Thank you very much for reporting this issue.

Every Arduino-compatible core has a WString.h that contains the definition of the String class.
Unfortunately, Teknic ClearCore renamed this file to ArduinoString.h.

To me, this is a mistake from Teknic and they must align their file names to the official ones; otherwise, they cannot claim to be Arduino-compatible.
@youcangetme, can you contact Teknic support to report this issue?

Best regards,
Benoit

@bblanchon
Copy link
Owner

I spoke too quickly.

I just discovered that Arduino team has deprecated the WString.h header:

// including WString.h is deprecated, for all future projects use Arduino.h instead

I'll modify ArduinoJson to include Arduino.h instead.

@bblanchon
Copy link
Owner

The fix is available in the 6.x branch and will be available in the next release.

However, there is still an error when compiling for Teknic ClearCore:

arduino/api/deprecated-avr-comp/avr/pgmspace.h:107:49: error: 'const void*' is not a pointer-to-object type
 #define pgm_read_ptr(addr) (*(const void *)(addr))
                                                 ^

This is due to a bug in the hardware-independent core.

Until this bug is fixed, you can either:

Thanks again for reporting this issue 👍

@youcangetme
Copy link
Author

youcangetme commented Sep 16, 2020

Thanks @bblanchon ! This is progress so I am happy. I tried the other JSON libs and your's is the best license and the best code wise. Thank you for your time and help! I will try some of the work around and see if I can get past this.

@youcangetme
Copy link
Author

@bblanchon I used the follow and got it to compile. Thank you for helping!

#define ARDUINOJSON_ENABLE_PROGMEM 0 #include <ArduinoJson.h>

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants