Compilation error with 0012 Alpha and MMC librairy


I'm newby on Arduino cross-plateform and I have a problem of compilation.

I would compile MMC librairy available on link is on following message (sorry for the link but I can not post link in my first message).

I have a Duemilanove Arduino and microSD module and I use Arduino - 0012 Alpha development interface.

I have an AMD-64 PC on Ubuntu and I obtain about those errors when I want to compile :

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:48: error: 'byte' does not name a type

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:49: error: 'byte' does not name a type

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:50: error: 'byte' does not name a type

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:125: error: 'byte' does not name a type

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:140: error: 'byte' does not name a type

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:157: error: 'byte' does not name a type

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:169: error: expected ',' or '...' before 'command'

C:\DOCUME~1\...\LOCALS~1\Temp\build62924.tmp\/mmc.h:169: error: ISO C++ forbids declaration of 'uint8_t' with no type

 In function 'void loop()':

This is the result of compilation on my office PC (Core 2 Duo, Windows XP) and I obtain about the same errors on my personnal PC on Ubuntu.

A friend compile without problems on Arduino - 0011 Alpha but this software version does not support AMD-64 architecture.

Someone already have this problem ?

What I must change to compile on 0012 software ?

Please help me to solve this problem.


The link :

I can compile code mmc1_v2 with Arduino - 0011 Alpha on my office PC (Core 2 Duo, Windows XP).

What the differences between 0012 and 0011 compiler ?

Apparently the problem comes to byte type. Is there any problems with byte definition with C++ ?

The problem is solved (partialy) !

For an Arduino - 0012 Alpha, byte does not a type, it must be replace by unsigned char on all librairy files (mmc.h, mmc.cpp, etc).

uint8_t, uint16_t and uint32_t does not defined by default, we can defined them manually :

typedef unsigned char uint8_t;
typedef unsigned int uint16_t;
typedef unsigned long uint32_t;

Or include stdint.h in mmc.h for example :

#include <stdint.h>

It’s necessary to compile microfat librairies : Arduino Nut: u-Fat filesystem

The code compile on my office PC on Windows and on my PC on Ubuntu-64 but I don’t check it because I don’t receive my microSD reader and file must be created on the begining of SD card to use this librairy.

Rather than changing the code, you may be able to compile it by including "WProgram.h" in the header and cpp files.

WProgram.h define stdint.h but byte could be always a problem, no ?

WPprogram.h includes wiring.h which is where the arduino typedef for byte is found. Note that including wiring.h directly causes problems in version 0012. Did you try to include WProgram.h ?

I can't compile with WProgram.h inclusion.

The problem is difficult to solve, I don't succeed to obtain compilation without errors when I try simply to include WProgram.h in differents headers.


Sorry to hear you're having compilation problems - the move to version 0012 broke quite a few of my sketches :)

Are you still having the problem?

I was able to get mmc1_v2 to compile by:

a) adding #include <WProgram.h> at the top of mmc.h
b) deleting the wprogram.h tab in the project.

(I’m using 0013, but I bet it works for 0012 also.)


I had this same problem with a library I’m writing. (A reference to the byte type in the library header generates a compilation error.) The Morse tutorial example is out of date and talks about #including “WConstants.h” in your header. But as noted by mikalhart substituting #include <WProgram.h> works like a charm. Thanks for the solution.

I’m using 0013 on Windows.