| VS Arduino | |
| Visual Micro >> Microchip Studio (Atmel Studio 7) >> Ace Button library example won't compile in VM https://www.visualmicro.com/forums/YaBB.pl?num=1570060795 Message started by paulsoulsby on Oct 2nd, 2019 at 11:59pm | |
| Title: Ace Button library example won't compile in VM Post by paulsoulsby on Oct 2nd, 2019 at 11:59pm 
            Hi I'm using AS7 with VM 1909.27.0 and Arduino 1.8.5 I want to use the Ace Button library (https://github.com/bxparks/AceButton) and am currently playing with the examples. I have opened the ArrayButtons.ino example. It compiles and works fine in Arduino, but throws following errors in VM: Code (]Error compiling project sources ArrayButtons.ino: 17:18: error: variable or field 'handleEvent' declared void Debug build failed for project 'ArrayButtons' ArrayButtons.ino: 17:18: error: 'AceButton' was not declared in this scope ArrayButtons.ino:17: note suggested alternative AceButton.h:38: In file included from ArrayButtons.ino:11: from AceButton.h:50: note ace_button AceButton class AceButton { ArrayButtons.ino: 17:29: error: 'button' was not declared in this scope ArrayButtons.ino: 17:45: error: expected primary-expression before 'eventType ArrayButtons.ino: 17:64: error: expected primary-expression before 'buttonState[/code): 
 | 
| Title: Re: Ace Button library example won't compile in VM Post by Visual Micro on Oct 3rd, 2019 at 10:58am 
            Thanks for the clear example. The prototypes need to be n exact atch for the signature of the corresponding function. [code]void handleEvent(AceButton* button, uint8_t eventType, uint8_t buttonState);[/code] Does this help? | 
| Title: Re: Ace Button library example won't compile in VM Post by paulsoulsby on Oct 3rd, 2019 at 11:13am 
            That's perfect thanks!  All working now.
             | 
| Title: Re: Ace Button library example won't compile in VM Post by David Newberry on Dec 29th, 2020 at 4:08am 
            **Update: Fix mentioned doesn't work This issue still exists with AceButton but only in debug mode. If you load up any AceButton example and compile in debug mode you will get: Error compiling project sources AceButton.h:45: In file included from Debug build failed for project 'ClickVersusDoubleClickUsingSuppression' ClickVersusDoubleClickUsingSuppression.ino:22: from AceButton.h:51: note ace_button AceButton class AceButton { ClickVersusDoubleClickUsingSuppression.ino: 26:29: error: expected primary-expression before ',' token ClickVersusDoubleClickUsingSuppression.ino: 26:39: error: expected primary-expression before 'eventType ClickVersusDoubleClickUsingSuppression.ino: 26:58: error: expected primary-expression before ')' token The issue seems to be with adding the ace_button namespace. If you replace Code (c++): 
 with Code (c++): 
 then the example will compile just fine. I can't even comprehend where the error comes from because it references lines in the .ino file that don't match the error provided. | 
| Title: Re: Ace Button library example won't compile in VM Post by David Newberry on Dec 29th, 2020 at 4:46am 
            Turns out that I jumped ahead and the using statements I mentioned don't work.  I had to edit the example and explicitly put the namespace on each ace_button Class as follows to make it work: Code (c++): 
 | 
| VS Arduino » Powered by YaBB 2.6.12! YaBB Forum Software © 2000-2025. All Rights Reserved. |