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

Unable to compile example program on Arduino Uno #5

Open
Obscuriosity opened this issue Oct 13, 2023 · 2 comments
Open

Unable to compile example program on Arduino Uno #5

Obscuriosity opened this issue Oct 13, 2023 · 2 comments

Comments

@Obscuriosity
Copy link

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

@Obscuriosity
Copy link
Author

Obscuriosity commented Oct 16, 2023

I have tried the same example on an arduino Mega connected to a windows machine and the same errors appear. Both were compiled using Arduino IDE 2.x.x, I will try it on an older IDE and see if it makes a difference.

@Obscuriosity
Copy link
Author

Have tried to compile the same example in Arduino IDE 1.8.19 on Ubuntu and still no Joy.
The output is the same as that above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant