Skip to content

error: 'function' in namespace 'std' does not name a template type #4

@SmuggusM

Description

@SmuggusM

Arduino: 1.8.19 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

In file included from C:\Users\Documents\Arduino\libraries\CF_Rotary_Encoder\src/CFRotaryEncoder.h:11:0,

             from C:\Users\\Desktop\PROGRAMAÇÃO\arduin\CFRotaryEncoderExample\CFRotaryEncoderExample.ino:1:

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\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.

          ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\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.

          ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\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.

          ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\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.

          ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\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.

          ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:53:50: error: 'std::function' has not been declared

     void setOnShortPressReachedCallback(std::function<void()> func);                            // Define short time reached callback.

                                              ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:53:58: error: expected ',' or '...' before '<' token

     void setOnShortPressReachedCallback(std::function<void()> func);                            // Define short time reached callback.

                                                      ^

C:\Users\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:54:49: error: 'std::function' has not been declared

     void setOnLongPressReachedCallback(std::function<void()> func);                             // Define long time reached callback.

                                             ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:54:57: error: expected ',' or '...' before '<' token

     void setOnLongPressReachedCallback(std::function<void()> func);                             // Define long time reached callback.

                                                     ^

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:55:38: error: 'std::function' has not been declared

     void setOnPressCallback(std::function<void()> func);                                        // Define button press callback.

                                  ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:55:46: error: expected ',' or '...' before '<' token

     void setOnPressCallback(std::function<void()> func);                                        // Define button press callback.

                                          ^

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:56:43: error: 'std::function' has not been declared

     void setOnShortPressCallback(std::function<void()> func);                                   // Define button short press callback.

                                       ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:56:51: error: expected ',' or '...' before '<' token

     void setOnShortPressCallback(std::function<void()> func);                                   // Define button short press callback.

                                               ^

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\src/CFPushButton.h:57:42: error: 'std::function' has not been declared

     void setOnLongPressCallback(std::function<void()> func);                                    // Define button long press callback.

                                      ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CFPushButton-1.0.0\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 C:\Users\Desktop\PROGRAMAÇÃO\arduin\CFRotaryEncoderExample\CFRotaryEncoderExample.ino:1:0:

C:\Users\Documents\Arduino\libraries\CF_Rotary_Encoder\src/CFRotaryEncoder.h:41:54: error: 'std::function' has not been declared

     void setBeforeRotaryChangeValueCallback(std::function<void()> func);

                                                  ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CF_Rotary_Encoder\src/CFRotaryEncoder.h:41:62: error: expected ',' or '...' before '<' token

     void setBeforeRotaryChangeValueCallback(std::function<void()> func);

                                                          ^

C:\Users\Documents\Arduino\libraries\CF_Rotary_Encoder\src/CFRotaryEncoder.h:42:53: error: 'std::function' has not been declared

     void setAfterRotaryChangeValueCallback(std::function<void()> func);

                                                 ^~~~~~~~

C:\Users\Documents\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 C:\Users\Desktop\PROGRAMAÇÃO\arduin\CFRotaryEncoderExample\CFRotaryEncoderExample.ino:1:0:

C:\Users\Documents\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.

                                                        ^~~~~~~~

C:\Users\Documents\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.

                                                                ^

C:\Users\Documents\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.

                                                       ^~~~~~~~

C:\Users\Documents\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.

                                                               ^

C:\Users\Documents\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.

                                            ^~~~~~~~

C:\Users\Documents\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.

                                                    ^

C:\Users\Documents\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.

                                                 ^~~~~~~~

C:\Users\Documents\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.

                                                         ^

C:\Users\Documents\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.

                                                ^~~~~~~~

C:\Users\Documents\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.

                                                        ^

C:\Users\Documents\Arduino\libraries\CF_Rotary_Encoder\src/CFRotaryEncoder.h:78:14: error: 'function' in namespace 'std' does not name a template type

     std::function<void()> _beforeRotaryChangeValueCallback;

          ^~~~~~~~

C:\Users\Documents\Arduino\libraries\CF_Rotary_Encoder\src/CFRotaryEncoder.h:79:14: error: 'function' in namespace 'std' does not name a template type

     std::function<void()> _afterRotaryChangeValueCallback;

          ^~~~~~~~

exit status 1

Error compiling for board Arduino Nano.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

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