Skip to content
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

error: 'String' does not name a type. (base64.h) #7516

Closed
4 of 6 tasks
FlorSanders opened this issue Aug 11, 2020 · 1 comment · Fixed by #7517
Closed
4 of 6 tasks

error: 'String' does not name a type. (base64.h) #7516

FlorSanders opened this issue Aug 11, 2020 · 1 comment · Fixed by #7517

Comments

@FlorSanders
Copy link

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-12
  • Core Version: 2.7.1
  • Development Env: Arduino IDE
  • Operating System: Windows

Settings in IDE

  • Module: NodeMCU 1.0
  • Flash Mode: ?
  • Flash Size: 4MB
  • lwip Variant: v2 Lower Memory
  • Reset Method: nodemcu
  • Flash Frequency: 40MHz
  • CPU Frequency: 80MHz
  • Upload Using: SERIAL
  • Upload Speed: 115200

Problem Description

Compiler error stemming from the \cores\esp8266\base64.h.
Can be fixed by adding #include <WString.h> in base64.h though I suppose that's not the prefered fix.
Didn't find any other mention of this issue at first sight, so I thought I'd mention it.

The issue occurs when working with the KPN_SenML library, which has this Base64 library as a dependency, and occurs after applying the first step of the workaround mentioned by SimonKlausLudwig.

MCVE Sketch

#include <kpn_senml.h>

void setup(){
}

void loop(){
}

Debug Messages

In file included from C:\Users\flors\Documents\Arduino\libraries\arduino-base64-master\MyBase64.cpp:1:0:

C:\Users\flors\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Base64.h:36:12: error: 'String' does not name a type

static String encode(const uint8_t * data, size_t length, bool doNewLines = true);

C:\Users\flors\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.7.1\cores\esp8266/Base64.h:37:12: error: 'String' does not name a type

static String inline encode(const String& text, bool doNewLines = true)

exit status 1
@d-a-v
Copy link
Collaborator

d-a-v commented Aug 11, 2020

Can be fixed by adding #include <WString.h> in base64.h though I suppose that's not the prefered fix.

Because String is used in this file, I think it is perfectly legal and harmless to include its declaration.
the #ifndef/#define/#endif triplets in every .h files are there to allow it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants