Welcome! Log In Create A New Profile

Advanced

Odd Compilation error - boards.h???

Posted by SJMaybury 
Odd Compilation error - boards.h???
May 26, 2016 06:32AM
So I was setting up Marlin for my new printer, firmware version Marlin 1.1.0-RC4 (not the latest but I've used it before) and did a compile check. It came up with this error;
Quote

Build options changed, rebuilding all
In file included from sketch/Configuration.h:41:0,
                 from Marlin-RC/Marlin/Marlin.ino:37:
boards.h:94: error: operator '==' has no right operand
 #define MB(board) (MOTHERBOARD==BOARD_##board)
                                              ^
sketch/pins.h:82:7: note: in expansion of macro 'MB'
 #elif MB(ULTIMAKER)
       ^
In file included from sketch/Configuration_adv.h:658:0,
                 from sketch/Configuration.h:941,
                 from Marlin-RC/Marlin/Marlin.ino:37:
Conditionals.h:518: error: operator '&&' has no right operand
   #define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLERFAN_PIN != FAN2_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN2_PIN)
                                                           ^
sketch/Conditionals.h:609:7: note: in expansion of macro 'HAS_FAN2'
   #if HAS_FAN2
       ^
In file included from sketch/Configuration_adv.h:658:0,
                 from sketch/Configuration.h:941,
                 from Marlin-RC/Marlin/Marlin.ino:37:
Conditionals.h:517: error: operator '&&' has no right operand
   #define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLERFAN_PIN != FAN1_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN1_PIN)
                                                           ^
sketch/Conditionals.h:611:9: note: in expansion of macro 'HAS_FAN1'
   #elif HAS_FAN1
         ^
Conditionals.h:517: error: operator '&&' has no right operand
   #define HAS_FAN1 (PIN_EXISTS(FAN1) && CONTROLLERFAN_PIN != FAN1_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN1_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN1_PIN)
                                                           ^
sketch/Conditionals.h:623:7: note: in expansion of macro 'HAS_FAN1'
   #if HAS_FAN1
       ^
In file included from sketch/Configuration_adv.h:658:0,
                 from sketch/Configuration.h:941,
                 from Marlin-RC/Marlin/Marlin.ino:37:
Conditionals.h:518: error: operator '&&' has no right operand
   #define HAS_FAN2 (PIN_EXISTS(FAN2) && CONTROLLERFAN_PIN != FAN2_PIN && EXTRUDER_0_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_1_AUTO_FAN_PIN != FAN2_PIN && EXTRUDER_2_AUTO_FAN_PIN != FAN2_PIN)
                                                           ^
sketch/Conditionals.h:626:7: note: in expansion of macro 'HAS_FAN2'
   #if HAS_FAN2
       ^
In file included from sketch/Configuration.h:42:0,
                 from Marlin-RC/Marlin/Marlin.ino:37:
macros.h:58: error: operator '&&' has no right operand
 #define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0)
                                                         ^
sketch/Conditionals.h:511:27: note: in expansion of macro 'PIN_EXISTS'
   #define HAS_AUTO_FAN_0 (PIN_EXISTS(EXTRUDER_0_AUTO_FAN))
                           ^
sketch/Conditionals.h:515:25: note: in expansion of macro 'HAS_AUTO_FAN_0'
   #define HAS_AUTO_FAN (HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3)
                         ^
sketch/SanityCheck.h:337:5: note: in expansion of macro 'HAS_AUTO_FAN'
 #if HAS_AUTO_FAN
     ^
In file included from sketch/Configuration_adv.h:659:0,
                 from sketch/Configuration.h:941,
                 from Marlin-RC/Marlin/Marlin.ino:37:
SanityCheck.h:351: error: operator '&&' has no right operand
 #if HAS_FAN0 && CONTROLLERFAN_PIN == FAN_PIN
                                   ^
In file included from sketch/Configuration.h:42:0,
                 from Marlin-RC/Marlin/Marlin.ino:37:
macros.h:58: error: operator '&&' has no right operand
 #define PIN_EXISTS(PN) (defined(PN ##_PIN) && PN ##_PIN >= 0)
                                                         ^
sketch/Conditionals.h:519:30: note: in expansion of macro 'PIN_EXISTS'
   #define HAS_CONTROLLERFAN (PIN_EXISTS(CONTROLLERFAN))
                              ^
sketch/SanityCheck.h:355:5: note: in expansion of macro 'HAS_CONTROLLERFAN'
 #if HAS_CONTROLLERFAN
     ^
exit status 1
operator '==' has no right operand
It keeps making reference to the boards.h file, which I haven't touched except to choose my board (GT2560, recognised as board 7: Ultimaker)
Re: Odd Compilation error - boards.h???
May 26, 2016 12:26PM
Are you using a current version of the Arduino IDE?

In configuration.h is the board defined correctly?

For example:
#define MOTHERBOARD BOARD_ULTIMAKER
Re: Odd Compilation error - boards.h???
May 26, 2016 02:54PM
Using the current version. Interestingly, no, Everything seemed to suggest "BOARD" instead of "MOTHERBOARD". Used the latter and that seems to have cleared up that. Thanks! Not the only issue I have to sort though sad smiley
Re: Odd Compilation error - boards.h???
May 26, 2016 05:27PM
In the version of Marlin I have here, that first error line is in boards.h.

The problem is with "BOARD_##board" -- you can't have # characters in a name. You need to replace BOARD_##board with the name of your board (e.g. BOARD_ULTIMAKER).

I guess that somehow the boards.h that you edited has been overwritten with the default
Re: Odd Compilation error - boards.h???
May 26, 2016 10:04PM
In line #define MB(board) (MOTHERBOARD==BOARD_##board)
The ‘##’ preprocessing operator performs token pasting. When a macro is expanded, the two tokens on either side of each ‘##’ operator are combined into a single token, which then replaces the ‘##’
( from [gcc.gnu.org] )
so MB(ULTIMAKER) becomes MOTHERBOARD==BOARD_ULTIMAKER)

In Configuration.h need to uncomment ( remove // at start) your motherboard
#define MOTHERBOARD BOARD_ULTIMAKER


So in pins.h
#if MB(ULTIMAKER)
#define KNOWN_BOARD
becomes
#if MOTHERBOARD==BOARD_ULTIMAKER
#define KNOWN_BOARD
Sorry, only registered users may post in this forum.

Click here to login