Unmodified Blink doesn't compile

Some time ago I've bought the Arduino Uno Board, Revision 2 with ATMEGA328P-PU Mircrocontroller, but I never found the time to play with it, until now.

Today I have installed the Arduino IDE Version 1.6.0 (most recent version) on my Windows PC (Windows 7). Installation of the USB driver went well but when I tried to download the Blink program it didn't even compile. I used the Blink program that came with the IDE, right out of the bix without any modifications. If you need the example code, just check "Files->Examples->01 Basics->Blink" but the other examples give the same errors.

I am thankfull for any clue how to solve this problem. Could there be anything wrong with the installation? Any compiler options I don't know about?

Here comes the error error log:

Arduino: 1.6.0 (Windows 7), Platine: "Arduino Uno"

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
from Blink.ino:18:
/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 /
^
/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 /
^
/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 /
^
/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 */
^
/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);
^
/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);
^
/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);
^
/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);
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1173:38: error: 'uint_farptr_t' has not been declared
extern size_t strlcat_PF (char *dst, uint_farptr_t src, size_t siz);
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1174:38: error: 'uint_farptr_t' has not been declared
extern char *strncat_PF (char *dest, uint_farptr_t src, size_t len);
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1175:39: error: 'uint_farptr_t' has not been declared
extern int strcmp_PF (const char *s1, uint_farptr_t s2) ATTR_PURE;
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1176:40: error: 'uint_farptr_t' has not been declared
extern int strncmp_PF (const char *s1, uint_farptr_t s2, size_t n) ATTR_PURE;
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1177:43: error: 'uint_farptr_t' has not been declared
extern int strcasecmp_PF (const char *s1, uint_farptr_t s2) ATTR_PURE;
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1178:44: error: 'uint_farptr_t' has not been declared
extern int strncasecmp_PF (const char *s1, uint_farptr_t s2, size_t n) ATTR_PURE;
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1179:41: error: 'uint_farptr_t' has not been declared
extern char *strstr_PF (const char *s1, uint_farptr_t s2);
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1180:38: error: 'uint_farptr_t' has not been declared
extern size_t strlcpy_PF (char *dst, uint_farptr_t src, size_t siz);
^
/Arduino/hardware/tools/avr/avr/include/avr/pgmspace.h:1181:36: error: 'uint_farptr_t' has not been declared
extern int memcmp_PF(const void *, uint_farptr_t, size_t) ATTR_PURE;
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:23:0,
from Blink.ino:18:
\MinGW\include/ctype.h: In function 'int isalnum(int)':
\MinGW\include/ctype.h:154:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isalnum(int c) {return __ISCTYPE(c, (_ALPHA|_DIGIT));}
^
\MinGW\include/ctype.h: In function 'int isalpha(int)':
\MinGW\include/ctype.h:155:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isalpha(int c) {return __ISCTYPE(c, _ALPHA);}
^
\MinGW\include/ctype.h: In function 'int iscntrl(int)':
\MinGW\include/ctype.h:156:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW iscntrl(int c) {return __ISCTYPE(c, _CONTROL);}
^
\MinGW\include/ctype.h: In function 'int isdigit(int)':
\MinGW\include/ctype.h:157:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isdigit(int c) {return __ISCTYPE(c, _DIGIT);}
^
\MinGW\include/ctype.h: In function 'int isgraph(int)':
\MinGW\include/ctype.h:158:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isgraph(int c) {return __ISCTYPE(c, (_PUNCT|_ALPHA|_DIGIT));}
^
\MinGW\include/ctype.h: In function 'int islower(int)':
\MinGW\include/ctype.h:159:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW islower(int c) {return __ISCTYPE(c, _LOWER);}
^
\MinGW\include/ctype.h: In function 'int isprint(int)':
\MinGW\include/ctype.h:160:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isprint(int c) {return __ISCTYPE(c, (_BLANK|_PUNCT|_ALPHA|_DIGIT));}
^
\MinGW\include/ctype.h: In function 'int ispunct(int)':
\MinGW\include/ctype.h:161:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW ispunct(int c) {return __ISCTYPE(c, _PUNCT);}
^
\MinGW\include/ctype.h: In function 'int isspace(int)':
\MinGW\include/ctype.h:162:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isspace(int c) {return __ISCTYPE(c, _SPACE);}
^
\MinGW\include/ctype.h: In function 'int isupper(int)':
\MinGW\include/ctype.h:163:65: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isupper(int c) {return __ISCTYPE(c, _UPPER);}
^
\MinGW\include/ctype.h: In function 'int isxdigit(int)':
\MinGW\include/ctype.h:164:66: error: '_imp____mb_cur_max_dll' was not declared in this scope
__CRT_INLINE int __cdecl __MINGW_NOTHROW isxdigit(int c) {return __ISCTYPE(c, _HEX);}
^
\MinGW\include/ctype.h: In function 'int isblank(int)':
\MinGW\include/ctype.h:169:12: error: '_imp____mb_cur_max_dll' was not declared in this scope
{return (__ISCTYPE(c, _BLANK) || c == '\t');}
^

It compiles fine for me so it looks like your installation is corrupted. I would recommend renaming the "C:\Program Files (x86)\Arduino" directory and then re-install Arduino 1.6.0.

johnwasser:
I would recommend renaming the "C:\Program Files (x86)\Arduino" directory and then re-install Arduino 1.6.0.

In addition to John's suggestion, I would try moving the entire Arduino directory to something other than Program Files (x86). The parenthesis could be giving you grief.

Hello I've got similar problem on Windows 8.1 64bit. I've solved by:

  1. remove Arduino 1.6.0
  2. install Arduino 1.6.0 in C:\Arduino
  3. follow this instruction Tiny85 PCREL error - Microcontrollers - Arduino Forum to install and configure WinAVR
  4. remove MinGW from your system PATH

You can try do it as i described but I can't guarantee that it will work in your case.

Hello, thank you all three for the advice. I did step 1) 2) and 4) and it didn't help
(Step 4 I had done previous to posting here because of things I've read in an oth thread).

Now I did step 3) until the point where it commes to modifying "avrdude.conf" and I think this might be too specific. It was for that other problem with a ATtiny.

However now the error log changed, so at least one step forward, I am happy! But now I need more help in getting this solved. What could be the problem now? Looks like I am missing some DLLs. Where would I get them from?

So now the error log is:

Arduino: 1.6.0 (Windows 7), Platine: "Arduino Uno"

In file included from C:\Arduino\hardware\arduino\avr\cores\arduino/WCharacter.h:23,

from C:\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:221,

from Blink.ino:18:

C:\MinGW\include/ctype.h: In function 'int isalnum(int)':

C:\MinGW\include/ctype.h:154: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isalpha(int)':

C:\MinGW\include/ctype.h:155: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int iscntrl(int)':

C:\MinGW\include/ctype.h:156: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isdigit(int)':

C:\MinGW\include/ctype.h:157: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isgraph(int)':

C:\MinGW\include/ctype.h:158: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int islower(int)':

C:\MinGW\include/ctype.h:159: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isprint(int)':

C:\MinGW\include/ctype.h:160: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int ispunct(int)':

C:\MinGW\include/ctype.h:161: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isspace(int)':

C:\MinGW\include/ctype.h:162: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isupper(int)':

C:\MinGW\include/ctype.h:163: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isxdigit(int)':

C:\MinGW\include/ctype.h:164: error: '_imp____mb_cur_max_dll' was not declared in this scope

C:\MinGW\include/ctype.h: In function 'int isblank(int)':

C:\MinGW\include/ctype.h:169: error: '_imp____mb_cur_max_dll' was not declared in this scope

Sounds like "MinGW" is causing problems with your Arduino compiles. I don't know how that is happening or what "MinGW" is. If you don't need it, try renaming the C:\MinGW directory.

Thanks, johnwasser, renaming MinGW solved the problem.

In general MinGW provieds GNU tools (in the first place GCC) for Windows, which would normally only be available on Linux systems. MinGW stands for "Minimal GNU on Windows". I needed it once, but don't need it right now.

Only for curiosity: Is there any document in the Web which explains why the Arduino GUI interfers with MinGW?

Is there any document in the Web which explains why the Arduino GUI interfers with MinGW?

You mean the other way around.
It's NOT supposed to. The arduino IDE includes all the required binaries and provides explicit paths for all binaries, libraries, and include file directories, and I'm pretty sure that the derived paths are supposed to be relative to the compiler location itself.

(I think the current version of the compiler is mingw-based. Perhaps there is a mingw version conflict between what you have installed and what avr-gcc uses. (Yuck.))

I suppose Tschatschim PATH environment variable specified paths like C:\MinGW\include. Therefore gcc was finding ctype.h into that folder instead of the correct one, that is IDE/hardware/tools/avr/avr/include/ctype.h

As westfw said, the IDE provides everything you need to compile and upload a sketch.

Despite being unrelated to the above issue, I confirm the windows toolchain bundled with 1.6.1 is statically compiled with mingw: it does not depend on mingw in any way and it's about 20% faster than the previous version, which was compiled with cygwin