Pages: [1]   Go Down
Author Topic: error: 'byte' does not name a type  (Read 8018 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Sketch on.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to compile the example code for the Arduino Ethernet shield on my new Illuminato, and I'm getting this error:

error: 'byte' does not name a type In function 'void setup()':

The example code is from the playground;
Code:
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
byte server[] = { 64, 233, 187, 99 }; // Google

Client client(server, 80);

void setup()
{
  Ethernet.begin(mac, ip);
  Serial.begin(9600);

  delay(1000);

  Serial.println("connecting...");

  if (client.connect()) {
    Serial.println("connected");
    client.println("GET /search?q=arduino HTTP/1.0");
    client.println();
  } else {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;;)
      ;
  }
}

The highlighted line is byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

I'm assuming something is borked in the Illuminato core files, since it will compile fine if I select another board than the Illuminato. Unfortunately, I have only a vague idea what the "core files" actually do, and I'm way out of my league to debug this. The liquidware guys seem to be otherwise engaged, so I'm hoping to find some insight here! I'd really like to be able to play with my Ethernet shield!

Thanks for your help!
« Last Edit: January 25, 2009, 08:30:54 pm by cscade » Logged

I hope I don't blow myself up.

Seattle, WA
Offline Offline
Jr. Member
**
Karma: 0
Posts: 81
Arduino rocks my socks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

above the #include, try throwing in:
Code:
#define byte uint8_t

or just change all the byte's to uint8_t
« Last Edit: January 26, 2009, 05:33:00 am by acleone » Logged

Norway@Oslo
Offline Offline
Edison Member
*
Karma: 12
Posts: 2033
loveArduino(true);
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll prosume the previous poster ment:
Code:
#define uint8_t byte
or
Code:
#define unsigned char byte

?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Sketch on.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the responses! Unfortunately, this solved the issue in the scope of my sketch, but uncovered many more compile errors. I'll post them here, but would not be surprised if I just need to sit on my hands and wait for updated core files  :-[
Code:


In file included from /usr/local/AVRMacPack-20081213/lib/gcc/avr/4.3.2/../../../../avr/include/util/delay.h:39,

                 from /usr/local/AVRMacPack-20081213/lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:37,

                 from /Applications/arduino-0012LW/hardware/cores/illuminato/wiring.h:7,

                 from /Applications/arduino-0012LW/hardware/cores/illuminato/WProgram.h:8,

/usr/local/AVRMacPack-20081213/lib/gcc/avr/4.3.2/../../../../avr/include/util/delay_basic.h:65: error: variable or field '_delay_loop_1' declared void

/usr/local/AVRMacPack-20081213/lib/gcc/avr/4.3.2/../../../../avr/include/util/delay_basic.h:65: error: 'byte' was not declared in this scope

/usr/local/AVRMacPack-20081213/lib/gcc/avr/4.3.2/../../../../avr/include/util/delay_basic.h:81: error: variable or field '_delay_loop_1' declared void

/usr/local/AVRMacPack-20081213/lib/gcc/avr/4.3.2/../../../../avr/include/util/delay_basic.h:81: error: 'byte' was not declared in this scope

In file included from /usr/local/AVRMacPack-20081213/lib/gcc/avr/4.3.2/../../../../avr/include/avr/delay.h:37,

                 from /Applications/arduino-0012LW/hardware/cores/illuminato/wiring.h:7,

                 from /Applications/arduino-0012LW/hardware/cores/illuminato/WProgram.h:8,

 In function 'void setup()':

« Last Edit: January 26, 2009, 07:48:38 am by cscade » Logged

I hope I don't blow myself up.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 29
Sketch on.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@acleone Thanks, this worked!  smiley-grin I tried AlphaBeta's response first, and never tried yours until now.

Compiles just fine. Can you give me some deeper insight into what is going on here behind the scenes? Should this define statement exist somewhere in the Illuminato core files, such that I can add it myself and avoid this particular gotcha?
Logged

I hope I don't blow myself up.

Pages: [1]   Go Up
Jump to: