Skip to content

Unable to compile example program on Arduino Uno #5

Open
@Obscuriosity

Description

@Obscuriosity

Hello Ciao, I am trying to run your example program on a linux ubuntu 20.04. Compiling this code on an arduino Uno results in the following errors...
I see that a similar issue has been closed previously but I can see no solution and, as I am experiencing, it still seems to be an issue.

In file included from /home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:11:0,
from /tmp/.arduinoIDE-unsaved2023913-19749-196z2v0.6pb3/CFRotaryEncoderExample/CFRotaryEncoderExample.ino:1:
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:31:14: error: 'function' in namespace 'std' does not name a template type
std::function<void()> _onShortPressReachedCallback; // Called when short time is reached.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:32:14: error: 'function' in namespace 'std' does not name a template type
std::function<void()> _onLongPressReachedCallback; // Called when long time is reached.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:33:14: error: 'function' in namespace 'std' does not name a template type
std::function<void()> _onPressCallback; // Called when button is pressed.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:34:14: error: 'function' in namespace 'std' does not name a template type
std::function<void()> _onShortPressCallback; // Called when button is short pressed.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:35:14: error: 'function' in namespace 'std' does not name a template type
std::function<void()> _onLongPressCallback; // Called when button is longe pressed.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:53:50: error: 'std::function' has not been declared
void setOnShortPressReachedCallback(std::function<void()> func); // Define short time reached callback.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:53:58: error: expected ',' or '...' before '<' token
void setOnShortPressReachedCallback(std::function<void()> func); // Define short time reached callback.
^
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:54:49: error: 'std::function' has not been declared
void setOnLongPressReachedCallback(std::function<void()> func); // Define long time reached callback.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:54:57: error: expected ',' or '...' before '<' token
void setOnLongPressReachedCallback(std::function<void()> func); // Define long time reached callback.
^
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:55:38: error: 'std::function' has not been declared
void setOnPressCallback(std::function<void()> func); // Define button press callback.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:55:46: error: expected ',' or '...' before '<' token
void setOnPressCallback(std::function<void()> func); // Define button press callback.
^
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:56:43: error: 'std::function' has not been declared
void setOnShortPressCallback(std::function<void()> func); // Define button short press callback.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:56:51: error: expected ',' or '...' before '<' token
void setOnShortPressCallback(std::function<void()> func); // Define button short press callback.
^
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:57:42: error: 'std::function' has not been declared
void setOnLongPressCallback(std::function<void()> func); // Define button long press callback.
^~~~~~~~
/home/tony/Arduino/libraries/CFPushButton/src/CFPushButton.h:57:50: error: expected ',' or '...' before '<' token
void setOnLongPressCallback(std::function<void()> func); // Define button long press callback.
^
In file included from /tmp/.arduinoIDE-unsaved2023913-19749-196z2v0.6pb3/CFRotaryEncoderExample/CFRotaryEncoderExample.ino:1:0:
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:41:54: error: 'std::function' has not been declared
void setBeforeRotaryChangeValueCallback(std::function<void()> func);
^~~~~~~~
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:41:62: error: expected ',' or '...' before '<' token
void setBeforeRotaryChangeValueCallback(std::function<void()> func);
^
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:42:53: error: 'std::function' has not been declared
void setAfterRotaryChangeValueCallback(std::function<void()> func);
^~~~~~~~
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:42:61: error: expected ',' or '...' before '<' token
void setAfterRotaryChangeValueCallback(std::function<void()> func);
^
In file included from /tmp/.arduinoIDE-unsaved2023913-19749-196z2v0.6pb3/CFRotaryEncoderExample/CFRotaryEncoderExample.ino:1:0:
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:57:60: error: 'std::function' has not been declared
void setPushButtonOnShortPressReachedCallback(std::function<void()> func); // Define short time reached callback.
^~~~~~~~
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:57:68: error: expected ',' or '...' before '<' token
void setPushButtonOnShortPressReachedCallback(std::function<void()> func); // Define short time reached callback.
^
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:58:59: error: 'std::function' has not been declared
void setPushButtonOnLongPressReachedCallback(std::function<void()> func); // Define long time reached callback.
^~~~~~~~
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:58:67: error: expected ',' or '...' before '<' token
void setPushButtonOnLongPressReachedCallback(std::function<void()> func); // Define long time reached callback.
^
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:59:48: error: 'std::function' has not been declared
void setPushButtonOnPressCallback(std::function<void()> func); // Define button press callback.
^~~~~~~~
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:59:56: error: expected ',' or '...' before '<' token
void setPushButtonOnPressCallback(std::function<void()> func); // Define button press callback.
^
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:60:53: error: 'std::function' has not been declared
void setPushButtonOnShortPressCallback(std::function<void()> func); // Define button short press callback.
^~~~~~~~
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:60:61: error: expected ',' or '...' before '<' token
void setPushButtonOnShortPressCallback(std::function<void()> func); // Define button short press callback.
^
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:61:52: error: 'std::function' has not been declared
void setPushButtonOnLongPressCallback(std::function<void()> func); // Define button long press callback.
^~~~~~~~
/home/tony/Arduino/libraries/CF_Rotary_Encoder/src/CFRotaryEncoder.h:61:60: error: expected ',' or '...' before '<' token
void setPushButtonOnLongPressCallback(std::function<void()> func); // Define button long press callback.
^

exit status 1

Compilation error: exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions