Pages: [1]   Go Down
Author Topic: Compiling Error for DUE, but not for MEGA ?  (Read 1051 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 3
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
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,
paulinchen
Logged

Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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,

Transistorfips
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

paulinchen 
Logged

Germany
Offline Offline
Jr. Member
**
Karma: 0
Posts: 57
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 3
Posts: 97
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

in

#define DEBUG true

wird der sketch jetzt fehlerfrei compiliert.

Vielen Dank und ein schönes Wochenende.
paulinchen
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: