cygig / SDConfigCommand

SDConfigCommand streamlines reading settings from a config file on SD card.
7 stars 5 forks source link

ISO C++ forbids declaration of 'callback_Function' with no type [-fpermissive] 60 | (*callback_Function)(); #3

Open mikepdiy opened 3 years ago

mikepdiy commented 3 years ago

Hi there,

Awesome library and it compiles well for AVR boards for for SAMD (m0) boards gives an error . I have tried to compile on: Arduino 1.8.13 MacOS Catalina 10.15.7 Latest version of the library

Full error: In file included from /var/folders/vw/gvtyfvy50bj0jkk29_hdnx9m0000gn/T/arduino_modified_sketch_77544/ReadAndWriteConfigFileExample.ino:20: /Users/mike/Documents/Arduino/libraries/SDConfigCommand/src/SDConfigCommand.h:60:26: error: ISO C++ forbids declaration of 'callback_Function' with no type [-fpermissive] 60 | (*callback_Function)(); | ^ exit status 1 Error compiling for board Adafruit QT PY (SAMD21).

I am a novice so please tell me if there is something that I would have to change on my side.

cygig commented 3 years ago

I am a novice as well, I don't have a M0 and I have no idea as well.

mikepdiy commented 3 years ago

No worries :-). You can close the issue then :-D

frittna commented 3 years ago

hi there, since i got exactly the same error while compiling this great app for a M5Stack Core-ESP32 in Arduino, i am wondering if someone knows the problem? regards

cygig commented 3 years ago

Again I'm not sure, but I have a feeling it has something to do with the fact that processCmd function is void. I have no idea how to do a C++ callback with non-void datatype.

Maybe you wanna try adding bool to the processCmd function and return a 1 at the end. I doubt it will work, but worth a shot. I am currently busy with my day job, thus unable to do much research on this issue.

Akrai commented 3 years ago

So i'm having the same issue, anybody solved it?

mikepdiy commented 3 years ago

So i'm having the same issue, anybody solved it?

I actually ended up using another project that helped me to achieve a similar funationality . You have a bit more work to do but maybe it helps. As an idea I am running this on an ATSAMD21E18 and it compiles nicely in Arduino IDE. The project mentioned is here .

Akrai commented 3 years ago

So i'm having the same issue, anybody solved it?

I actually ended up using another project that helped me to achieve a similar funationality . You have a bit more work to do but maybe it helps. As an idea I am running this on an ATSAMD21E18 and it compiles nicely in Arduino IDE. The project mentioned is here .

I just saw the pending push request which fixes this issue, thanks anyway!

cygig commented 3 years ago

I finally got the time to look into it, and from some Youtube videos, I realised I did not declare the datatype for the callback function. Strangely, it was allowed to run on my Pro Micro. I had since fixed it and I hope it works this time. So sorry.

cygig commented 3 years ago

So i'm having the same issue, anybody solved it?

I actually ended up using another project that helped me to achieve a similar funationality . You have a bit more work to do but maybe it helps. As an idea I am running this on an ATSAMD21E18 and it compiles nicely in Arduino IDE. The project mentioned is here .

I just saw the pending push request which fixes this issue, thanks anyway!

I feel so dumb, what exactly is a push request? I really suck at using github.

Akrai commented 3 years ago

So i'm having the same issue, anybody solved it?

I actually ended up using another project that helped me to achieve a similar funationality . You have a bit more work to do but maybe it helps. As an idea I am running this on an ATSAMD21E18 and it compiles nicely in Arduino IDE. The project mentioned is here .

I just saw the pending push request which fixes this issue, thanks anyway!

I feel so dumb, what exactly is a push request? I really suck at using github.

Well, an open repository can receive commits from other people, and you can accept them to merge them into your code

Open pull requests to this project: https://github.com/cygig/SDConfigCommand/pulls

You can enter the commit and see the changes in the code: https://github.com/cygig/SDConfigCommand/pull/2/commits/36e8edd7072f2daf0cf15e311beb201965f09ecf

You already fixed the code, so just close the commit or something

cygig commented 3 years ago

So i'm having the same issue, anybody solved it?

I actually ended up using another project that helped me to achieve a similar funationality . You have a bit more work to do but maybe it helps. As an idea I am running this on an ATSAMD21E18 and it compiles nicely in Arduino IDE. The project mentioned is here .

I just saw the pending push request which fixes this issue, thanks anyway!

I feel so dumb, what exactly is a push request? I really suck at using github.

Well, an open repository can receive commits from other people, and you can accept them to merge them into your code

Open pull requests to this project: https://github.com/cygig/SDConfigCommand/pulls

You can enter the commit and see the changes in the code: 36e8edd

You already fixed the code, so just close the commit or something

I see! Yea it seems like they did the same fix as me. Now let me figure out how to close the commit.