You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would to make my dev OOP, so each object need to include <TaskScheduler.h>
But it fails during the link process.
The platform used is a WEMOS D1 MINI ESP32
Here is a working example
config.h
#ifndef __CONFIG_H__
#define __CONFIG_H__
#define Test 123
#endif
#include <Arduino.h>
#include "main.h"
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
The compile complete correctly, it produce only one warning (already an issue)
Now if I include <TaskScheduler.h> in an other file, the linking process fails for multiple definition of elements
In the previous example modify following files
main.h
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::isEnabled()':
C:\Users\ppcm\Documents\PlatformIO\Projects\Test/.pio\libdeps\wemos_d1_mini32\TaskScheduler\src/TaskScheduler.h:458: multiple definition of `Task::isEnabled()'
.pio\build\wemos_d1_mini32\src\A.cpp.o:C:\Users\ppcm\Documents\PlatformIO\Projects\Test/.pio\libdeps\wemos_d1_mini32\TaskScheduler\src/TaskScheduler.h:458: first defined here
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::getInterval()':
main.cpp:(.text._ZN4Task11getIntervalEv+0x0): multiple definition of `Task::getInterval()'
.pio\build\wemos_d1_mini32\src\A.cpp.o:A.cpp:(.text._ZN4Task11getIntervalEv+0x0): first defined here
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::getIterations()':
main.cpp:(.text._ZN4Task13getIterationsEv+0x0): multiple definition of `Task::getIterations()'
.pio\build\wemos_d1_mini32\src\A.cpp.o:A.cpp:(.text._ZN4Task13getIterationsEv+0x0): first defined here
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::getRunCounter()':
main.cpp:(.text._ZN4Task13getRunCounterEv+0x0): multiple definition of `Task::getRunCounter()'
.pio\build\wemos_d1_mini32\src\A.cpp.o:A.cpp:(.text._ZN4Task13getRunCounterEv+0x0): first defined here
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::setCallback(void (*)())':
main.cpp:(.text._ZN4Task11setCallbackEPFvvE+0x0): multiple definition of `Task::setCallback(void (*)())'
.pio\build\wemos_d1_mini32\src\A.cpp.o:A.cpp:(.text._ZN4Task11setCallbackEPFvvE+0x0): first defined here
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::setOnEnable(bool (*)())':
main.cpp:(.text._ZN4Task11setOnEnableEPFbvE+0x0): multiple definition of `Task::setOnEnable(bool (*)())'
.pio\build\wemos_d1_mini32\src\A.cpp.o:A.cpp:(.text._ZN4Task11setOnEnableEPFbvE+0x0): first defined here
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::setOnDisable(void (*)())':
main.cpp:(.text._ZN4Task12setOnDisableEPFvvE+0x0): multiple definition of `Task::setOnDisable(void (*)())'
.pio\build\wemos_d1_mini32\src\A.cpp.o:A.cpp:(.text._ZN4Task12setOnDisableEPFvvE+0x0): first defined here
.pio\build\wemos_d1_mini32\src\main.cpp.o: In function `Task::reset()':
main.cpp:(.text._ZN4Task5resetEv+0x0): multiple definition of `Task::reset()'
.pio\build\wemos_d1_mini32\src\A.cpp.o:A.cpp:(.text._ZN4Task5resetEv+0x0): first defined here
[...]
This is not the complete error because it is too long, but the idea is here
Is there something wrong in the declaration of prototypes of TaskScheduler?
Thanks for your help
The text was updated successfully, but these errors were encountered:
Hello,
I would to make my dev OOP, so each object need to include
<TaskScheduler.h>
But it fails during the link process.
The platform used is a WEMOS D1 MINI ESP32
Here is a working example
config.h
main.h
main.c
The compile complete correctly, it produce only one warning (already an issue)
Now if I include
<TaskScheduler.h>
in an other file, the linking process fails for multiple definition of elementsIn the previous example modify following files
main.h
A.h
A.cpp
It produces the following error:
This is not the complete error because it is too long, but the idea is here
Is there something wrong in the declaration of prototypes of TaskScheduler?
Thanks for your help
The text was updated successfully, but these errors were encountered: