Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Compiling "warning: "max" redefined" #1052

Open
CobaltEcho opened this issue Jul 7, 2021 · 2 comments
Open

Error Compiling "warning: "max" redefined" #1052

CobaltEcho opened this issue Jul 7, 2021 · 2 comments

Comments

@CobaltEcho
Copy link

CobaltEcho commented Jul 7, 2021

I've tried compiling/uploading several times, watched videos, re-read the instructions, followed step by step. And every time I'm getting this error:

On an Arduino Nano and using 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.
`
@franksterke
Copy link

Same problem here, @CobaltEcho did you find a solution?

@drf5n
Copy link

drf5n commented Apr 15, 2022

Those are just warnings, not errors.

They are a known issue in #228

You can work around them in a couple ways, per #228 (comment)

My preferred way is to use https://github.com/gnea/grbl/wiki/Compiling-Grbl#build-as-a-normal-arduino-ide-project

I use this procedure for a grbl install :

  1. From the command line:

     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. Open Arduino IDE

  3. File/Open/ (navigate to the grbl.ino file and open it)

  4. Compile and configure in the IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants