tinkersprojects / G-Code-Arduino-Library

Allows any machines and robots to be controlled by G-Code
GNU General Public License v3.0
52 stars 18 forks source link

Use gcode with function in .h file #10

Closed lelibreauquotidien closed 4 years ago

lelibreauquotidien commented 4 years ago

Good morning. I would like to use the library with a function declared in an h-file. My code is:

#include "core/functions.h"
#include <gcode.h>
void return_endstops_status();
commandscallback commands[1] = {{"L1",return_endstops_status}};
gcode Commands(1,commands);

My error is: undefined reference to return_endstops_status() Thank you

tinkersprojects commented 4 years ago

hey, i just tried it and you can do it, just need to make sure it is a void and not in a class. could you post more code please or send it to me on my email tinkersprojects@gmail.com. makes it a bit easier to work out the bug.

lelibreauquotidien commented 4 years ago

Send !