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

Using #include <ParametersSPIFFS.h> and #include <EspBootstrapDict.h> in the same .ino file causes redefinition errors #4

Open
jostsalathe opened this issue Feb 25, 2022 · 3 comments

Comments

@jostsalathe
Copy link

Originally I noticed the compilation to fail and saw the last output of the Arduino build which was the deprecation warning about SPIFFS.

On closer inspection I just noticed that the actual cause of the failure are a lot of redefinition errors like this:

In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/EspBootstrapDict.h:37,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:8:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h: At global scope:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:3:8: error: redefinition of 'int8_t node::create(const char*, uint8_t, const char*, uint8_t, node*, node*)'
3 | int8_t node::create(const char* aKey, _DICT_KEY_TYPE aKeySize, const char* aVal, _DICT_VAL_TYPE aValSize, node* aLeft, node* aRight) {
|        ^~~~
In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/ParametersSPIFFS.h:35,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:7:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:3:8: note: 'int8_t node::create(const char*, uint8_t, const char*, uint8_t, node*, node*)' previously defined here
3 | int8_t node::create(const char* aKey, _DICT_KEY_TYPE aKeySize, const char* aVal, _DICT_VAL_TYPE aValSize, node* aLeft, node* aRight) {
      |        ^~~~
In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/EspBootstrapDict.h:37,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:8:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:58:8: error: redefinition of 'int8_t node::updateValue(const char*, uint8_t)'
58 | int8_t node::updateValue(const char* aVal, _DICT_VAL_TYPE aValSize) {
|        ^~~~
In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/ParametersSPIFFS.h:35,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:7:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:58:8: note: 'int8_t node::updateValue(const char*, uint8_t)' previously defined here
   58 | int8_t node::updateValue(const char* aVal, _DICT_VAL_TYPE aValSize) {
      |        ^~~~
[...]

I have the feeling that the Dictionary library has changed since I last successfully built my project (jostsalathe/HumiTempSensor). It appears to me that it has no header guard surrounding its contents which would make it unsuitable for including it in multiple other header files...

Now I don't really know what to do with that information, though...

Would you mind checking if you can reproduce this? Just to be sure that my setup isn't just broken, somehow...

Originally posted by @jostsalathe in #3 (comment)

@jostsalathe
Copy link
Author

Sorry for mixing topics... The reason this happend is already given over there: #3 (comment)

@jostsalathe
Copy link
Author

jostsalathe commented Feb 25, 2022

I just tried replacing #include <Dictionary.h> with #include <DictionaryDeclarations.h> in #include <ParametersSPIFFS.h> and #include <EspBootstrapDict.h> following the information that you mentioned are given here: https://github.com/arkhipenko/Dictionary#platformio-support. When building with Arduino 1.8.19 this seems to resolve the issue for my case.

@jostsalathe
Copy link
Author

jostsalathe commented Feb 25, 2022

For now I can of course just roll back to Dictionary library v3.4.0 for my project. ¯\_(ツ)_/¯

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

No branches or pull requests

1 participant