Go Down

Topic: Compiling Error for DUE, but not for MEGA ? (Read 1 time) previous topic - next topic


i will update a sketch from a MEGA to my new DUE...

But i have the following error (IDE 1.5.2):

In file included from c:\programme\arduino-1.5.2\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/stdlib.h:21,
                 from C:\Programme\arduino-1.5.2\hardware\arduino\sam\cores\arduino/Arduino.h:23,
                 from C:\Programme\arduino-1.5.2\hardware\arduino\sam\variants\arduino_due_x/variant.h:26,
                 from C:\Programme\arduino-1.5.2\hardware\arduino\sam\libraries\SPI/SPI.h:14,
                 from THS_DUE_2013_002.ino:148:
c:\programme\arduino-1.5.2\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/sys/reent.h:490: error: #if with no expression

The same sketch can i compile without errors in the same IDE for a MEGA.

many thanks,


c:\programme\arduino-1.5.2\hardware\tools\g++_arm_none_eabi\bin\../lib/gcc/arm-none-eabi/4.4.1/../../../../arm-none-eabi/include/sys/reent.h:490: error: #if with no expression

The Error is outside of your sketch. Head honcho g++ tells you that the file reent.h which is to be used for compiling code for the SAM3X is botched. So the message ensues. Have you messed in this file before?
This file is not used for the Atmega Mega so no error occur.

Hope this helps,



I made no changes in the Files.  Only install the IDE.   :smiley-eek:



This is the code of reent.h of Ver.1.5.2

Line 489..495 states:
/* Only built the assert() calls if we are built with debugging.  */
# if DEBUG
#  include <assert.h>
#  define __reent_assert(x) assert(x)
# else
#  define __reent_assert(x) ((void)0)
# endif

If the touch-stone "DEBUG" is omitted the compiler grumbles. Maybe a bug in your version because this feature hasn't been fully tested.


Hallo Transistorfips,
vielen Dank für Deine Hilfe.

Ich hatte bei mir im Sketch auch ein #define DEBUG drin, allerdings ohne anschliessenden Wert.

Nach der Änderung von

#define DEBUG


#define DEBUG true

wird der sketch jetzt fehlerfrei compiliert.

Vielen Dank und ein schönes Wochenende.


Interesting, seems to be a bug in the GCC code, reent.h should have "#ifdef DEBUG"?

I'm slightly puzzled as to why this problem does not occur more often, it seems like it should happen whenever DEBUG is not defined.
Please don't PM me asking for help. Ask questions in the forum.

Go Up

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

shortcuts: alt+s submit/post or alt+p preview