Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Error compilation for ESP32 #2

Closed
zobix opened this issue Mar 31, 2020 · 5 comments
Closed

Error compilation for ESP32 #2

zobix opened this issue Mar 31, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@zobix
Copy link

zobix commented Mar 31, 2020

Hello!

I get an Error compilation for ESP32. Arduino IDE 1.8.12, ESP32 core 1.0.4. Many redifinitions errors. How to fix it?

Log of compilator:

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:35:2: warning: #warning Neither EEPROM nor SPIFFS selected. Default to EEPROM [-Wcpp]

#warning Neither EEPROM nor SPIFFS selected. Default to EEPROM

^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:44:1: error: redefinition of 'DoubleResetDetector::DoubleResetDetector(int, int)'

DoubleResetDetector::DoubleResetDetector(int timeout, int address)

^

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:88:5: note: 'DoubleResetDetector::DoubleResetDetector(int, int)' previously defined here

 DoubleResetDetector(int timeout, int address)

 ^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:60:6: error: redefinition of 'bool DoubleResetDetector::detectDoubleReset()'

bool DoubleResetDetector::detectDoubleReset()

  ^

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:116:10: note: 'bool DoubleResetDetector::detectDoubleReset()' previously defined here

 bool detectDoubleReset()

      ^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:84:6: error: redefinition of 'void DoubleResetDetector::loop()'

void DoubleResetDetector::loop()

  ^

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:142:10: note: 'void DoubleResetDetector::loop()' previously defined here

 void loop()

      ^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:96:6: error: redefinition of 'void DoubleResetDetector::stop()'

void DoubleResetDetector::stop()

  ^

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:154:10: note: 'void DoubleResetDetector::stop()' previously defined here

 void stop()

      ^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:102:6: error: redefinition of 'bool DoubleResetDetector::detectRecentlyResetFlag()'

bool DoubleResetDetector::detectRecentlyResetFlag()

  ^

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:169:10: note: 'bool DoubleResetDetector::detectRecentlyResetFlag()' previously defined here

 bool detectRecentlyResetFlag()

      ^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:121:6: error: redefinition of 'void DoubleResetDetector::setRecentlyResetFlag()'

void DoubleResetDetector::setRecentlyResetFlag() {

  ^

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:212:10: note: 'void DoubleResetDetector::setRecentlyResetFlag()' previously defined here

 void setRecentlyResetFlag()

      ^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:139:6: error: redefinition of 'void DoubleResetDetector::clearRecentlyResetFlag()'

void DoubleResetDetector::clearRecentlyResetFlag() {

  ^

In file included from C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:19:0:

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.h:257:10: note: 'void DoubleResetDetector::clearRecentlyResetFlag()' previously defined here

 void clearRecentlyResetFlag()

      ^

C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp:23:17: warning: 'DOUBLERESETDETECTOR_FLAG' defined but not used [-Wunused-variable]

static uint32_t DOUBLERESETDETECTOR_FLAG;

@khoih-prog
Copy link
Owner

You have to start from the simplest code, such as the example. Then add more features gradually to see when it has errors.
Anyway, without your actual code, I can't provide any help.

@zobix
Copy link
Author

zobix commented Apr 10, 2020

The sketch from the example does not compile. No more features have been added. Only example/minimal.ino

@zobix
Copy link
Author

zobix commented Apr 10, 2020

actual code:
#include <ESP_DoubleResetDetector.h>

// Number of seconds after reset during which a
// subseqent reset will be considered a double reset.
#define DRD_TIMEOUT 10

// RTC Memory Address for the DoubleResetDetector to use
#define DRD_ADDRESS 0

DoubleResetDetector drd(DRD_TIMEOUT, DRD_ADDRESS);

void setup()
{
//pinMode(LED_BUILTIN, OUTPUT);

Serial.begin(115200);
Serial.println();
Serial.println("DoubleResetDetector Example Program");
Serial.println("-----------------------------------");

if (drd.detectDoubleReset()) {
Serial.println("Double Reset Detected");
//digitalWrite(LED_BUILTIN, LOW);
} else {
Serial.println("No Double Reset Detected");
//digitalWrite(LED_BUILTIN, HIGH);
}
}

void loop()
{
// Call the double reset detector loop method every so often,
// so that it can recognise when the timeout expires.
// You can also call drd.stop() when you wish to no longer
// consider the next reset as a double reset.
drd.loop();
}

@khoih-prog
Copy link
Owner

khoih-prog commented Apr 10, 2020

HI @zobix,
Thanks for using the library and reporting the bug, which causes by the left-over cpp file.
Please use the new version v1.0.2 where the bug has been fixed and your contribution noted.
Sorry for the inconvenience so far,
Regards,

PS: Actually, I check and find out that the ESP_DoubleResetDetector.cpp is not included in v1.0.1. It's possible a left-over in the file system from previous v1.0.0 version after you install the v1.0.1. Please check and erase that ESP_DoubleResetDetector.cpp file in your library directory.
The location in your system is
C:\Users\User\Documents\Arduino\libraries\ESP_DoubleResetDetector-master\src\ESP_DoubleResetDetector.cpp

@zobix
Copy link
Author

zobix commented Apr 11, 2020

Hi khoih-prog!
Fine! Great library, thanks a lot!

@khoih-prog khoih-prog added the bug Something isn't working label Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants