error: #elif with no expression

I am new to Arduino and I am trying to compile Marlin 2.0 firmware for a 3D printer but I keep getting errors while trying to verify, here is the error message. I am looking for something I can do to solve these issues, thanks for the help. If there is a thread that I haven't found on this topic with fixes please direct me thee, thanks.

Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\MarlinConfigPre.h:35:0,

from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\marlinconfig.h:28,

from sketch\src\gcode\feature\trinamic\M911-M914.cpp:23:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

In file included from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\MarlinConfigPre.h:35:0,

from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\marlinconfig.h:28,

from sketch\src\feature\baricuda.cpp:23:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

In file included from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\MarlinConfigPre.h:35:0,

from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\marlinconfig.h:28,

from sketch\src\feature\babystep.cpp:23:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

In file included from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\marlinconfigpre.h:35:0,

from sketch\src\feature\backlash.cpp:23:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

In file included from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\MarlinConfigPre.h:35:0,

from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\marlinconfig.h:28,

from sketch\src\gcode\geometry\G17-G19.cpp:23:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

In file included from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\MarlinConfigPre.h:35:0,

from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\marlinconfig.h:28,

from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\gcode\gcode.h:275,

from sketch\src\gcode\geometry\G53-G59.cpp:23:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

In file included from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\MarlinConfigPre.h:35:0,

from c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\src\inc\marlinconfig.h:28,

from sketch\src\feature\closedloop.cpp:22:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

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

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Can you post your code so we can have a look at what might be causing the error?

As well as this, can you find this file: sketch\src\feature\closedloop.cpp and post it here.

The whole firmware was too big to upload so I included the config.h and config_.h files. Let me know if you need anything else, thanks.

closedloop.cpp (1.38 KB)

Configuration.h (87.7 KB)

Configuration_adv.h (94.6 KB)

Have you read this and followed all of the steps?

Which version of Marlin are you using and what version of arduino IDE?

To find arduino version, launch arduino and "Help > About Arduino"

The version on Marlin will be on the folder name

Also, found a configuration tool that might help you here

I am using Marlin 2.0 and Arduino 1.8.9, I did not write this but I got it from a community for my printer and the person that made it said to change a few lines to configure it for my printer and I should be good to go, but I got errors and he did not respond to questions I asked.

Try using an older version of Marlin. 2.0 is in alpha (Means not fully tested). This could be that whatever you're using isn't currently working because it hasn't been fully tested.

Im sorry I can't be more help. Hopefully the person you are talking to replies.

The error message makes the problem clear:

TheCactus152:

c:\users\admin\appdata\local\temp\arduino_build_403913\sketch\configuration.h:159:6: error: #elif with no expression

Take a look at line 159 of configuration.h:

#elif

That's invalid syntax. #elif directives must have a clause.

TheCactus152:
the person that made it said to change a few lines to configure it for my printer

My suspicion is that this change was when the error was introduced. The question is whether the source of the error was "the person" or you. Please provide an exact quote of the changes "the person" told you to make.

This is the instructions he sent.

Hello and thank you for using this configuration. This is based on the Marlin 2.0 Anycubic version.

To make this configuration work, please make the following changes in the configuration.h file.

  1. Line 28
    Comment out the "#define HE3D_Plus" if you have a K200.

  2. Line 31
    Select probe type -- If select custom, you will need to edit your options in the appropriot section.

  3. Line 37
    define heated bed

  4. Line 521
    Update bowden length -- measure from center of motor gear on extruder to end of ptfe (hotend) -- this will affect the filament change distances.

  5. Lines 629-633
    If using on K200 - please verify rod sizes. (these were filled in from thier supplied configs, but these are currently untested.

====

In this version you will get the following features:

Nozzle Park; -- Currently at Center (0,0) z+20
Advance Pause; -- For M600 filament change
S Curve Acceleration;
Pause to deploy/stow the ABL sensor; -- Line 1069
Restore Level after G28;
ABL 9x9 test;
Prusa Style Layout of Screen; -- Line 1708
Slim Menus; -- Line 1743 - To reduce memory