HELP Error compiling for board Arduino Mega or Mega 2560

Goodmorning evryone

im sorry for my english

Can you help me evryone with this error???

In file included from sketch\src\MarlinCore.cpp:55:0:

sketch\src\module/stepper.h:240:7: error: redefinition of 'class Stepper'

 class Stepper {

       ^~~~~~~

In file included from c:\users\pirjo\appdata\local\temp\arduino_build_456722\sketch\configuration.h:1:0,

                 from sketch\src\inc/MarlinConfigPre.h:39,

                 from sketch\src\inc/MarlinConfig.h:28,

                 from sketch\src\MarlinCore.h:24,

                 from sketch\src\MarlinCore.cpp:31:

C:\Program Files (x86)\Arduino\libraries\Stepper\src/Stepper.h:83:7: note: previous definition of 'class Stepper'

 class Stepper {

       ^~~~~~~

sketch\src\MarlinCore.cpp: In function 'void setup()':

sketch\src\MarlinCore.cpp:1278:21: error: 'class Stepper' has no member named 'init'

   SETUP_RUN(stepper.init());          // Init stepper. This enables interrupts!

                     ^

sketch\src\MarlinCore.cpp:1068:53: note: in definition of macro 'SETUP_RUN'

   #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0)

                                                     ^

exit status 1
Error compiling for board Arduino Mega or Mega 2560.
In file included from sketch\src\MarlinCore.cpp:55:0:

sketch\src\module/stepper.h:240:7: error: redefinition of 'class Stepper'

 class Stepper {

       ^~~~~~~

In file included from c:\users\pirjo\appdata\local\temp\arduino_build_456722\sketch\configuration.h:1:0,

                 from sketch\src\inc/MarlinConfigPre.h:39,

                 from sketch\src\inc/MarlinConfig.h:28,

                 from sketch\src\MarlinCore.h:24,

                 from sketch\src\MarlinCore.cpp:31:

C:\Program Files (x86)\Arduino\libraries\Stepper\src/Stepper.h:83:7: note: previous definition of 'class Stepper'

 class Stepper {

       ^~~~~~~

sketch\src\MarlinCore.cpp: In function 'void setup()':

sketch\src\MarlinCore.cpp:1278:21: error: 'class Stepper' has no member named 'init'

   SETUP_RUN(stepper.init());          // Init stepper. This enables interrupts!

                     ^

sketch\src\MarlinCore.cpp:1068:53: note: in definition of macro 'SETUP_RUN'

   #define SETUP_RUN(C) do{ SETUP_LOG(STRINGIFY(C)); C; }while(0)

                                                     ^

exit status 1
Error compiling for board Arduino Mega or Mega 2560.

Always start with the first error.

redefinition of 'class Stepper'

That's not good. Arduino has a Stepper library and it seems that there is a "stepper.h" as well in the Marlin code.
The conflict for the class Stepper is at line 240, which is here: https://github.com/MarlinFirmware/Marlin/blob/2.0.x/Marlin/src/module/stepper.h#L240

Have you included the Arduino Stepper library in your *.ino file with: #include <Stepper.h> ?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.