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

Compilation Failed #6

Open
marcusobrien opened this issue Jan 17, 2023 · 3 comments
Open

Compilation Failed #6

marcusobrien opened this issue Jan 17, 2023 · 3 comments
Assignees

Comments

@marcusobrien
Copy link

Hi,

Fresh install on x86 Linux Ubuntu 20.04.1 LTS, of Platformio and VS Code. Cloned this repo, imported the project (and folder), and compiled it with ESP32 toolchain.

Fails to compile with following errors

In file included from src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:3:0:
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:17:9: error: 'std::function' has not been declared
std::function<uint8_t()> getter,
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:17:17: error: expected ',' or '...' before '<' token
std::function<uint8_t()> getter,
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:34:8: error: 'function' in namespace 'std' does not name a template type
std::function<uint8_t()> getter;
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:35:8: error: 'function' in namespace 'std' does not name a template type
std::function<void(uint8_t)> setter;
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h: In constructor 'AlarmSettingsTimeSpinner::AlarmSettingsTimeSpinner(uint8_t, uint8_t, int)':
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:21:10: error: 'class AlarmSettingsTimeSpinner' has no member named 'getter'
this->getter = getter;
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:21:19: error: 'getter' was not declared in this scope
this->getter = getter;
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:22:10: error: 'class AlarmSettingsTimeSpinner' has no member named 'setter'
this->setter = setter;
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.h:22:19: error: 'setter' was not declared in this scope
this->setter = setter;
^
src/Apps/Alarm/AlarmListener.cpp: In member function 'virtual void AlarmListener::handle()':
src/Apps/Alarm/AlarmListener.cpp:28:33: warning: statement has no effect [-Wunused-value]
if (dayInWeek == 0) {dayInWeek == 6;}
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp: In member function 'virtual void AlarmSettingsTimeSpinner::render()':
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:20:60: error: 'class AlarmSettingsTimeSpinner' has no member named 'getter'
(void)snprintf(valueStr, sizeof(valueStr), "%02d", this->getter());
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp: In member function 'virtual bool AlarmSettingsTimeSpinner::handleTouch(uint8_t, uint8_t)':
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:40:13: error: 'class AlarmSettingsTimeSpinner' has no member named 'getter'
if (this->getter() == 0) {
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:41:10: error: 'class AlarmSettingsTimeSpinner' has no member named 'setter'
this->setter(this->maxValue);
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:43:10: error: 'class AlarmSettingsTimeSpinner' has no member named 'setter'
this->setter(this->getter() - 1);
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:43:23: error: 'class AlarmSettingsTimeSpinner' has no member named 'getter'
this->setter(this->getter() - 1);
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:52:13: error: 'class AlarmSettingsTimeSpinner' has no member named 'getter'
if (this->getter() == this->maxValue) {
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:53:10: error: 'class AlarmSettingsTimeSpinner' has no member named 'setter'
this->setter(0);
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:55:10: error: 'class AlarmSettingsTimeSpinner' has no member named 'setter'
this->setter(this->getter() + 1);
^
src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp:55:23: error: 'class AlarmSettingsTimeSpinner' has no member named 'getter'
this->setter(this->getter() + 1);
^
*** [.pio/build/ttgo-t-watch/src/Apps/Alarm/Components/Settings/AlarmSettingsTimeSpinner.cpp.o] Error 1
src/Apps/Alarm/Components/AlarmDisplay.cpp: In member function 'virtual void AlarmDisplay::render()':
src/Apps/Alarm/Components/AlarmDisplay.cpp:56:63: warning: 'prevX' may be used uninitialized in this function [-Wmaybe-uninitialized]
prevX += 4 + TTGOClass::getWatch()->tft->textWidth(days[i]);
^

@pvdzee
Copy link

pvdzee commented Jun 16, 2023

Same problem for me with Ubuntu 22.04.2, VS Code and PlatformIO. Any solution found already?

@pvdzee
Copy link

pvdzee commented Jun 16, 2023

Just found a solution:
Add #include functional (with functional between brackets <>) in files src/Userinterface/Components/Component.h and src/Core/Hardware/ESP32.h. Compiling and Uploading now successful. The programming experts may know a better solution, but this worked for me.
The watch is now in a continuous startup loop...

@spaceAngel
Copy link
Owner

Hello,
sorry for very late response (I put this project sleep for a while) ..

If still interest, please, try it again with nightly build or latest (1.1) release. ... and let me know..

@spaceAngel spaceAngel self-assigned this Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants