Contact me: hankecnc@gmail.com

错误:变量或字段“limits_go_home”声明无效 #478

推推 grbl 3年前 (2023-01-22) 263次浏览

关闭
bobemoe 打开了这个问题 2014 年 8 月 29 日 · 5 条评论
关闭

错误:变量或字段“limits_go_home”声明无效#478

bobemoe 打开了这个问题 2014 年 8 月 29 日 · 5 条评论

注释

错误:变量或字段“limits_go_home”声明无效 #478

尝试编译草图,我已经按照说明将库导入到一个新草图中,只是一个#includes 列表,没有添加任何东西,但它不会编译。错误如下。有任何想法吗?使用 Arduino v1.0.5

In file included from sketch_aug29a.ino:1:0:
/home/bob/sketchbook/libraries/grbl/limits.h:36:21: error: variable or field 'limits_go_home' declared void
 void limits_go_home(uint8_t cycle_mask);
                     ^
/home/bob/sketchbook/libraries/grbl/limits.h:36:21: error: 'uint8_t' was not declared in this scope
In file included from sketch_aug29a.ino:4:0:
/home/bob/sketchbook/libraries/grbl/coolant_control.h:27:18: error: variable or field 'coolant_run' declared void
 void coolant_run(uint8_t mode);
                  ^
/home/bob/sketchbook/libraries/grbl/coolant_control.h:27:18: error: 'uint8_t' was not declared in this scope
In file included from sketch_aug29a.ino:5:0:
/home/bob/sketchbook/libraries/grbl/probe.h:33:1: error: 'uint8_t' does not name a type
 uint8_t probe_get_state();
 ^
In file included from sketch_aug29a.ino:6:0:
/home/bob/sketchbook/libraries/grbl/report.h:69:28: error: variable or field 'report_status_message' declared void
 void report_status_message(uint8_t status_code);
                            ^
/home/bob/sketchbook/libraries/grbl/report.h:69:28: error: 'uint8_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/report.h:72:27: error: variable or field 'report_alarm_message' declared void
 void report_alarm_message(int8_t alarm_code);
                           ^
/home/bob/sketchbook/libraries/grbl/report.h:72:27: error: 'int8_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/report.h:75:30: error: variable or field 'report_feedback_message' declared void
 void report_feedback_message(uint8_t message_code);
                              ^
/home/bob/sketchbook/libraries/grbl/report.h:75:30: error: 'uint8_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/report.h:99:26: error: variable or field 'report_startup_line' declared void
 void report_startup_line(uint8_t n, char *line);
                          ^
/home/bob/sketchbook/libraries/grbl/report.h:99:26: error: 'uint8_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/report.h:99:37: error: expected primary-expression before 'char'
 void report_startup_line(uint8_t n, char *line);
                                     ^
In file included from sketch_aug29a.ino:7:0:
/home/bob/sketchbook/libraries/grbl/nuts_bolts.h:64:1: error: 'uint8_t' does not name a type
 uint8_t read_float(char *line, uint8_t *char_counter, float *float_ptr);
 ^
/home/bob/sketchbook/libraries/grbl/nuts_bolts.h:67:15: error: variable or field 'delay_ms' declared void
 void delay_ms(uint16_t ms);
               ^
/home/bob/sketchbook/libraries/grbl/nuts_bolts.h:67:15: error: 'uint16_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/nuts_bolts.h:70:15: error: variable or field 'delay_us' declared void
 void delay_us(uint32_t us);
               ^
/home/bob/sketchbook/libraries/grbl/nuts_bolts.h:70:15: error: 'uint32_t' was not declared in this scope
In file included from sketch_aug29a.ino:9:0:
/home/bob/sketchbook/libraries/grbl/serial.h:54:19: error: variable or field 'serial_write' declared void
 void serial_write(uint8_t data);
                   ^
/home/bob/sketchbook/libraries/grbl/serial.h:54:19: error: 'uint8_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/serial.h:57:1: error: 'uint8_t' does not name a type
 uint8_t serial_read();
 ^
/home/bob/sketchbook/libraries/grbl/serial.h:63:1: error: 'uint8_t' does not name a type
 uint8_t serial_get_rx_buffer_count();
 ^
/home/bob/sketchbook/libraries/grbl/serial.h:67:1: error: 'uint8_t' does not name a type
 uint8_t serial_get_tx_buffer_count();
 ^
In file included from sketch_aug29a.ino:11:0:
/home/bob/sketchbook/libraries/grbl/motion_control.h:38:46: error: 'uint8_t' has not been declared
 void mc_line(float *target, float feed_rate, uint8_t invert_feed_rate);
                                              ^
/home/bob/sketchbook/libraries/grbl/motion_control.h:50:3: error: 'uint8_t' has not been declared
   uint8_t invert_feed_rate, uint8_t axis_0, uint8_t axis_1, uint8_t axis_linear);
   ^
/home/bob/sketchbook/libraries/grbl/motion_control.h:50:29: error: 'uint8_t' has not been declared
   uint8_t invert_feed_rate, uint8_t axis_0, uint8_t axis_1, uint8_t axis_linear);
                             ^
/home/bob/sketchbook/libraries/grbl/motion_control.h:50:45: error: 'uint8_t' has not been declared
   uint8_t invert_feed_rate, uint8_t axis_0, uint8_t axis_1, uint8_t axis_linear);
                                             ^
/home/bob/sketchbook/libraries/grbl/motion_control.h:50:61: error: 'uint8_t' has not been declared
   uint8_t invert_feed_rate, uint8_t axis_0, uint8_t axis_1, uint8_t axis_linear);
                                                             ^
/home/bob/sketchbook/libraries/grbl/motion_control.h:63:53: error: 'uint8_t' has not been declared
 void mc_probe_cycle(float *target, float feed_rate, uint8_t invert_feed_rate);
                                                     ^
In file included from sketch_aug29a.ino:12:0:
/home/bob/sketchbook/libraries/grbl/print.h:37:26: error: variable or field 'print_uint32_base10' declared void
 void print_uint32_base10(uint32_t n);
                          ^
/home/bob/sketchbook/libraries/grbl/print.h:37:26: error: 'uint32_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/print.h:39:24: error: variable or field 'print_uint8_base2' declared void
 void print_uint8_base2(uint8_t n);
                        ^
/home/bob/sketchbook/libraries/grbl/print.h:39:24: error: 'uint8_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/print.h:41:25: error: variable or field 'print_uint8_base10' declared void
 void print_uint8_base10(uint8_t n);
                         ^
/home/bob/sketchbook/libraries/grbl/print.h:41:25: error: 'uint8_t' was not declared in this scope
/home/bob/sketchbook/libraries/grbl/print.h:43:26: error: 'uint8_t' has not been declared
 void printFloat(float n, uint8_t decimal_places);
                          ^
错误:变量或字段“limits_go_home”声明无效 #478

所有这些文件应该#include "system.h",哪些应该#include <stdint.h>,哪些应该定义uint8_t

错误:变量或字段“limits_go_home”声明无效 #478

确保 .ino 文件在包含列表的前面包含“system.h”。(不是 <system.h>!Grbl 几乎不使用任何提供的包含文件的 ide。不要将 system.h 添加到每个包含文件中,这不是正确的方法:-)现有文件在 Atmel Visual Studio 中工作和其他开发环境,Arduino IDE 编写可能需要一些调整。

通常需要限制代码的文件在该序列中包括“system.h”和“limits.h”。例如 main.c

错误:变量或字段“limits_go_home”声明无效 #478

感谢您的澄清。我并不是建议编辑所有标题 – 我试图指出它应该如何工作,以帮助调试。“system.h”应该已经在需要它的文件中。

错误:变量或字段“limits_go_home”声明无效 #478
作者

是的,将 system.h 移动到包含列表的顶部允许草图编译!谢谢 :)

错误:变量或字段“limits_go_home”声明无效 #478

极好的。我更新了维基。

喜欢 (0)