Problems Compiling Anything 1.6.5r2 - Including Example Code (Blink)

Installed the Arduino 1.6.5 r2 installer into a blank directory on Win7 64. Install went fine.

Loaded "Example: Blink" and tried to compile. (Actually tried my previously compile-able code first). Error messages as follows:

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_YUN -DARDUINO_ARCH_AVR -DUSB_VID=0x2341 -DUSB_PID=0x8041 -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Yun" -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\yun C:\Users\mholmes\AppData\Local\Temp\build8718303218716738533.tmp\Blink.cpp -o C:\Users\mholmes\AppData\Local\Temp\build8718303218716738533.tmp\Blink.cpp.o 

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
                 from Blink.ino:18:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1167:26: error: 'uint_farptr_t' was not declared in this scope
 extern size_t strlen_PF (uint_farptr_t src) __ATTR_CONST__; /* program memory can't change */
                          ^
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1168:27: error: 'uint_farptr_t' was not declared in this scope
 extern size_t strnlen_PF (uint_farptr_t src, size_t len) __ATTR_CONST__; /* program memory can't change */
                           ^
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1168:53: error: expected primary-expression before 'len'
 extern size_t strnlen_PF (uint_farptr_t src, size_t len) __ATTR_CONST__; /* program memory can't change */
                                                     ^
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1168:58: error: expression list treated as compound expression in initializer [-fpermissive]
 extern size_t strnlen_PF (uint_farptr_t src, size_t len) __ATTR_CONST__; /* program memory can't change */
                                                          ^
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1169:37: error: 'uint_farptr_t' has not been declared
 extern void *memcpy_PF (void *dest, uint_farptr_t src, size_t len);
                                     ^
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1170:37: error: 'uint_farptr_t' has not been declared
 extern char *strcpy_PF (char *dest, uint_farptr_t src);
                                     ^
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1171:38: error: 'uint_farptr_t' has not been declared
 extern char *strncpy_PF (char *dest, uint_farptr_t src, size_t len);
                                      ^
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:1172:37: error: 'uint_farptr_t' has not been declared
 extern char *strcat_PF (char *dest, uint_farptr_t src);
  ....

Any idea what is going on to cause this behavior?
Thank you!

Hi Mark,

that's really weird, could you please enable "Verbose compile" in preferences, rebuild, and paste here the build output using the "Copy error message" button?
For which board are you compiling?

That was with the verbose option.
The text of the error messages were too long - attached.
Tried to compile for both a Yun and an older NG. Same result. Attached is the older NG.
Thank you for guidance you can offer!
Mark

OlderNG.txt (8.93 KB)

Sorry , this is related to my other question regarding environment variables. After deleting the following three environment variables:
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
LIBRARY_PATH
The code compiles fine. I wasn't sure if the problems were related to each other. But it looks like I need to figure out the solution described in Troubleshooting #14.

Please let me dig into this and I will write a report here.