Compile Error of a simple sketch

Hi everyone,

I compile this simple sketch with my Arduino UNO:

void setup() {
 // put your setup code here, to run once:
 Serial.begin(9600);
}

void loop() {
 // put your main code here, to run repeatedly:
 Serial.println("hello world!");
}

But I got the following error message:


Arduino:1.6.5 (Windows 7), "Arduino/Genuino Uno"

In file included from C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino\WInterrupts.c:30:0:
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1167:26: error: unknown type name 'uint_farptr_t'
extern size_t strlen_PF (uint_farptr_t src) ATTR_CONST; /* program memory can't change /
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1168:27: error: unknown type name 'uint_farptr_t'
extern size_t strnlen_PF (uint_farptr_t src, size_t len) ATTR_CONST; /
program memory can't change */
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1169:37: error: unknown type name 'uint_farptr_t'
extern void *memcpy_PF (void *dest, uint_farptr_t src, size_t len);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1170:37: error: unknown type name 'uint_farptr_t'
extern char *strcpy_PF (char *dest, uint_farptr_t src);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1171:38: error: unknown type name 'uint_farptr_t'
extern char *strncpy_PF (char *dest, uint_farptr_t src, size_t len);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1172:37: error: unknown type name 'uint_farptr_t'
extern char *strcat_PF (char *dest, uint_farptr_t src);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1173:38: error: unknown type name 'uint_farptr_t'
extern size_t strlcat_PF (char *dst, uint_farptr_t src, size_t siz);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1174:38: error: unknown type name 'uint_farptr_t'
extern char *strncat_PF (char *dest, uint_farptr_t src, size_t len);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1175:39: error: unknown type name 'uint_farptr_t'
extern int strcmp_PF (const char *s1, uint_farptr_t s2) ATTR_PURE;
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1176:40: error: unknown type name 'uint_farptr_t'
extern int strncmp_PF (const char *s1, uint_farptr_t s2, size_t n) ATTR_PURE;
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1177:43: error: unknown type name 'uint_farptr_t'
extern int strcasecmp_PF (const char *s1, uint_farptr_t s2) ATTR_PURE;
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1178:44: error: unknown type name 'uint_farptr_t'
extern int strncasecmp_PF (const char *s1, uint_farptr_t s2, size_t n) ATTR_PURE;
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1179:41: error: unknown type name 'uint_farptr_t'
extern char *strstr_PF (const char *s1, uint_farptr_t s2);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1180:38: error: unknown type name 'uint_farptr_t'
extern size_t strlcpy_PF (char *dst, uint_farptr_t src, size_t siz);
^
c:\program files\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1181:36: error: unknown type name 'uint_farptr_t'
extern int memcmp_PF(const void *, uint_farptr_t, size_t) ATTR_PURE;
^

And I've try other sketch, but I got the similar error.
Anybody can help me with this question? Thanks a lot.

Please edit your post, select the code, and put it between [code][/code] tags.

You can do that by hitting the “Code” icon above the posting area. It is the first icon, with the symbol: </>

Please use code tags.

Read this before posting a programming question

How to use this forum

Does anyone can help me?
I've try another Arduino board, and also reinstall the Arduino IDE, but it got the same error.

I just downloaded 1.6.5, and compiled your sketch. I get:

Global variables use 212 bytes (10%) of dynamic memory, leaving 1,836 bytes for local variables. Maximum is 2,048 bytes.

Agree, that sketch should compile no problem - something awful has happened to your Arduino install. It looks like it's got old versions of some files. Did you have a 1.5.x version installed on that computer? There are some files you're supposed to clear out before installing 1.6.5 if you had a 1.5.x version installed

Maybe there is environmental problem in my laptop?

PaulS:
I just downloaded 1.6.5, and compiled your sketch. I get:

I have solved this problem when I install the Arduino IDE with 1.0.6 Version.

Hi,

Did you have a 1.5.x version installed on that computer? There are some files you're supposed to clear out before installing 1.6.5 if you had a 1.5.x version installed

New to me, I have 1.5, 1.5.5, 1.6.0, 1.6.1, 1.6.3 and 1.6.5 installed and I have no problems running them on a 64bit Vindoz7 laptop and OS.

Tom.... :slight_smile: