Pages: [1]   Go Down
Author Topic: Compilation error with 0012 Alpha and MMC librairy  (Read 1017 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

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 :

Code:
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.

Thanks.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The link : http://www.sensor-networks.org/index.php?page=0827727742
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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++ ?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 :

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

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

Code:
#include <stdint.h>

It's necessary to compile microfat librairies : http://arduinonut.blogspot.com/2008/04/ufat.html

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

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6250
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 79
Combat, please!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

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

Are you still having the problem?
Logged

Austin, TX USA
Offline Offline
God Member
*****
Karma: 4
Posts: 997
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Mikal
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 24, 2009, 10:08:28 pm by billh » Logged

Pages: [1]   Go Up
Jump to: