Register / Login  |  Desktop view  |  Jump to bottom of page

tcMenu Arduinio library » Compiler error using Adafruit_GFX and ST7735 [solved]

Author: MartinBzm
09/09/2020 16:39:58
Hello all, hope you can help me.
I am using the Adafruit_GFX and the Adafruit_ST7735 libraries for a TFT display.
I have adjusted the .ino like this:
#include "tcMenu_menu.h"
#define P_S_RES 5
#define P_S_DC  6
#define P_S_CS  7
#define P_S_BL  50
Adafruit_ST7735 tftDisplay = Adafruit_ST7735(P_S_CS, P_S_DC, P_S_RES);

void setup() {
    setupMenu();
}

void loop() {
    taskManager.runLoop();
}


Now the compiler throws errors I cannot solve:
In file included from F:\Projecten\Arduino\libraries\IoAbstraction\src/SwitchInput.h:19:0,
                 from F:\Projecten\Arduino\libraries\IoAbstraction\src/IoAbstraction.h:244,
                 from F:\Projecten\Arduino\libraries\tcMenu\src/tcMenu.h:9,
                 from sketch\tcMenu_menu.h:15,
                 from F:\Projecten\Arduino\tcMenu\tcMenu.ino:1:
F:\Projecten\Arduino\libraries\IoAbstraction\src/TaskManager.h:90:6: error: multiple definition of 'enum TimerUnit'
 enum TimerUnit : uint8_t {
      ^~~~~~~~~
In file included from F:\Projecten\Arduino\libraries\TaskManagerIO\src/TaskManagerIO.h:17:0,
                 from F:\Projecten\Arduino\libraries\IoAbstraction\src/BasicIoAbstraction.h:15,
                 from F:\Projecten\Arduino\libraries\IoAbstraction\src/IoAbstraction.h:18,
                 from F:\Projecten\Arduino\libraries\tcMenu\src/tcMenu.h:9,
                 from sketch\tcMenu_menu.h:15,
                 from F:\Projecten\Arduino\tcMenu\tcMenu.ino:1:
F:\Projecten\Arduino\libraries\TaskManagerIO\src/TaskTypes.h:124:6: note: previous definition here
 enum TimerUnit : uint8_t {
      ^~~~~~~~~
In file included from F:\Projecten\Arduino\libraries\IoAbstraction\src/SwitchInput.h:19:0,
                 from F:\Projecten\Arduino\libraries\IoAbstraction\src/IoAbstraction.h:244,
                 from F:\Projecten\Arduino\libraries\tcMenu\src/tcMenu.h:9,
                 from sketch\tcMenu_menu.h:15,
                 from F:\Projecten\Arduino\tcMenu\tcMenu.ino:1:
F:\Projecten\Arduino\libraries\IoAbstraction\src/TaskManager.h:103:7: error: redefinition of 'class Executable'
 class Executable {
       ^~~~~~~~~~

The actual list of errors is much longer but hoping it is a simple oversight that will solve the rest as well.
Thanks for your support!

Author: davetcc
09/09/2020 21:20:55
It looks like you have an old version of IOAbstraction that still has TaskManager.h present. Can you check tcMenu and IOAbstraction libraries are fully up to date. Basically task manager was split out in the last release.

Author: MartinBzm
10/09/2020 08:33:13
OK Davetcc,
I have downloaded the libraries and unpacked them in the Arduino library folder, simply overwriting the libraries installed with the Arduino IDE library-manager.
Annnnd.... It works!
Thank you very much.

Author: davetcc
14/09/2020 14:02:44
That's a bit worrying though, it tends to suggest that existing users are going to hit this quite a bit.

Thanks for reporting this as we could start to see more cases of this.

We'll need to look at recreating this on a test machine.

Author: MartinBzm
14/09/2020 14:20:09
The root-cause is that I installed the libraries through the library manager of the Arduino IDE. The latest version there is older than the ones I downloaded from the site.

Author: davetcc
15/09/2020 06:51:32
I've tried this myself with Arduino IDE and it seems to remove the task manager files with the very latest version.

However, I've added back an empty TaskManager.cpp & a .h that just includes TaskManagerIO.h. This is probably the safe thing to do, and can be removed in the future once most people have had time to upgrade.

This should work with all versions of LibraryManager and all other IDEs/platforms too. I'll make a patch release for this soon.




Register / Login  |  Desktop view  |  Jump to top of page