-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: expected identifier before string constant #1978
Comments
Hi @dirkt68, Please share the complete compiler output. Best regards, |
I compiled
I only had to add |
Benoit, Thank you for responding so quickly, I am attaching the compiler output from the most recent one, apologies for the length. I am using the same version of the Arduino IDE, and I think there might be a difference between your test and my environment, as my FQBN is Thank you for your time, |
Hi Dirk, I could not install the RUI boards on the Arduino IDE. How did you do? Best regards, |
I was able to reproduce the issue by adding the following line at the top of the file: #define str_(s) #s I found this macro in: |
Oh wow, would adding a check and #undef solve the issue if put in the header? |
As a workaround, you can |
Benoit, Thanks so much for your quick help with all of this, renaming all instance of Sincerely, |
Description
Hello everyone,
I am currently using the single header file version of the library to try and do some basic serialization, and unfortunately I am having trouble with some errors coming up. I am assuming it is Visual Studio Code's fault, as the header file compiles fine on Programiz's Online Compiler. There are three spots marked as "errors" but which are valid syntax:
line 589 ->
SizedRamString(const char* str, size_t sz) : str_(str), size_(sz)
{} -> "expected identifier" (squiggle on the "s" instr_
)line 527 ->
ZeroTerminatedRamString(const char* str) : str_(str) {}
-> same problemline 888/889 ->
FlashString(const __FlashStringHelper* str, size_t sz) : str_(reinterpret_cast<const char*>(str)), size_(sz) {}
-> same problemThank you all for your help!
Troubleshooter's report
Environment
Reproduction code
Remarks
This also occurs in a blank project simply by including the header, so I do not believe it is code related. There are also a lot of undefined functions and other errors around the header file, but those three cause red squiggles. As a test, adding this header to a CLion PlatformIO project shows no errors whatsoever and compiles correctly.
The text was updated successfully, but these errors were encountered: