Contact me: hankecnc@gmail.com

错误编译“警告:“最大”重新定义” #1052

推推 grbl 3年前 (2023-01-23) 199次浏览

打开
CobaltEcho 打开了这个问题 2021 年 7 月 8 日 · 2 条评论
打开

错误编译“警告:“最大”重新定义”#1052

CobaltEcho 打开了这个问题 2021 年 7 月 8 日 · 2 条评论

注释

错误编译“警告:“最大”重新定义” #1052
钴回声 评论了 2021 年 7 月 8 日  

我试过多次编译/上传,观看视频,重新阅读说明,然后一步步进行。每次我收到此错误时:

在 Arduino Nano 上并使用 Arduino IDE 1.8.15

In file included from C:\Users\Echo\Documents\Arduino\libraries\grbl/grbl.h:43:0,
                 from C:\Users\Echo\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:
C:\Users\Echo\Documents\Arduino\libraries\grbl/nuts_bolts.h:51:0: warning: "max" redefined
 #define max(a,b) (((a) > (b)) ? (a) : (b))
 
In file included from sketch\grblUpload.ino.cpp:1:0:
C:\Users\Echo\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\cores\arduino/Arduino.h:93:0: note: this is the location of the previous definition
 #define max(a,b) ((a)>(b)?(a):(b))
 
In file included from C:\Users\Echo\Documents\Arduino\libraries\grbl/grbl.h:43:0,
                 from C:\Users\Echo\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:
C:\Users\Echo\Documents\Arduino\libraries\grbl/nuts_bolts.h:52:0: warning: "min" redefined
 #define min(a,b) (((a) < (b)) ? (a) : (b))
 
In file included from sketch\grblUpload.ino.cpp:1:0:
C:\Users\Echo\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\cores\arduino/Arduino.h:92:0: note: this is the location of the previous definition
 #define min(a,b) ((a)<(b)?(a):(b))
 
In file included from C:\Users\Echo\Documents\Arduino\libraries\grbl/grbl.h:43:0,
                 from C:\Users\Echo\Documents\Arduino\libraries\grbl\examples\grblUpload\grblUpload.ino:27:
C:\Users\Echo\Documents\Arduino\libraries\grbl/nuts_bolts.h:55:0: warning: "bit" redefined
 #define bit(n) (1 << n)
 
In file included from sketch\grblUpload.ino.cpp:1:0:
C:\Users\Echo\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\cores\arduino/Arduino.h:124:0: note: this is the location of the previous definition
 #define bit(b) (1UL << (b))
 
Sketch uses 29594 bytes (96%) of program storage space. Maximum is 30720 bytes.
Global variables use 1484 bytes (72%) of dynamic memory, leaving 564 bytes for local variables. Maximum is 2048 bytes.
`
错误编译“警告:“最大”重新定义” #1052

同样的问题,@CobaltEcho你找到解决办法了吗?

错误编译“警告:“最大”重新定义” #1052

这些只是警告,不是错误。

它们是#228中的已知问题

根据#228(评论),您可以通过几种方式解决它们

我的首选方法是使用https://github.com/gnea/grbl/wiki/Compiling-Grbl#build-as-a-normal-arduino-ide-project

我使用此过程进行 grbl 安装:

  1. 从命令行:

     git clone git@github.com:gnea/grbl.git   # download grbl
     touch grbl/grbl/grbl.ino        # create an empty grbl.ino file for the IDE
    
  2. 打开 Arduino IDE

  3. 文件/打开/(导航到 grbl.ino 文件并打开它)

  4. 在IDE中编译配置

喜欢 (0)