Usb-host shield problem

I just bought usb-host shield (sparkfun) and arduino duemilanove and try compile board_test.pde code examples from GitHub - felis/USB_Host_Shield: Libraries and code for Circuits@Home Arduino USB Host Shield, but i get error like this:

In file included from C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp:3:
C:\arduino\arduino-0020\libraries\USB_Host_Shield\/Max3421e.h:11: error: expected class-name before '{' token
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp: In static member function 'static void MAX3421E::regWr(byte, byte)':
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp:49: error: 'Spi' was not declared in this scope
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp: In member function 'char* MAX3421E::bytesWr(byte, byte, char*)':
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp:58: error: 'Spi' was not declared in this scope
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp: In member function 'byte MAX3421E::regRd(byte)':
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp:83: error: 'Spi' was not declared in this scope
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp: In member function 'char* MAX3421E::bytesRd(byte, byte, char*)':
C:\arduino\arduino-0020\libraries\USB_Host_Shield\Max3421e.cpp:93: error: 'Spi' was not declared in this scope

Can someone tell me what did I do wrong or post working example for me?

It looks like you have forgotten to install all the libraries you need.

I figure out what was problem. There was some typos in example code.
Is there any better ide than arduino ide?

Is there any better ide than arduino ide?

No it's the very best there is for the arduino.

Grumpy_Mike thanks for your advise.

I'd be more than happy if someone would make working example how to read data from USB port in USB host shield.
I think i have a problem with spi and max3421e libraries.

I use:
arduino 0020
Arduino Duemilanove
USB Host Shield: (SparkFun USB-C Host Shield - DEV-21247 - SparkFun Electronics)

I'd be more than happy if someone would make working example how to read data from USB port in USB host shield.

Sadly it is not as simple as that. The USB can be connected to a wide number of devices so you have to specify what sort of device you want to read data from.

My project final goal is to get arduino communicate with nokia s60 phone.
First i'd like to get same data from usb hid device like usb mouse.
I tried this from http://www.circuitsathome.com:

/* Mouse communication via control endpoint */
#include <spi.h>
#include <max3421e.h>
#include <usb.h>
 
#define DEVADDR 1
#define CONFVALUE 1
 
void setup();
void loop();
 
MAX3421E Max;
USB Usb;
 
void setup()
{
    Serial.begin( 115200 );
    Serial.println("Start");
    Max.powerOn();
    delay( 200 );
}
 
void loop()
{
 byte rcode;
    Max.Task();
    Usb.Task();
    if( Usb.getUsbTaskState() == USB_STATE_CONFIGURING ) {
        mouse0_init();
    }//if( Usb.getUsbTaskState() == USB_STATE_CONFIGURING...
    if( Usb.getUsbTaskState() == USB_STATE_RUNNING ) {  //poll the keyboard
        rcode = mouse0_poll();
        if( rcode ) {
          Serial.print("Mouse Poll Error: ");
          Serial.println( rcode, HEX );
        }//if( rcode...
    }//if( Usb.getUsbTaskState() == USB_STATE_RUNNING...
}
/* Initialize mouse */
void mouse0_init( void )
{
 byte rcode = 0;  //return code
  /**/
  Usb.setDevTableEntry( 1, Usb.getDevTableEntry( 0,0 ) );              //copy device 0 endpoint information to device 1
  /* Configure device */
  rcode = Usb.setConf( DEVADDR, 0, CONFVALUE );
  if( rcode ) {
    Serial.print("Error configuring mouse. Return code : ");
    Serial.println( rcode, HEX );
    while(1);  //stop
  }//if( rcode...
  Usb.setUsbTaskState( USB_STATE_RUNNING );
  return;
}
/* Poll mouse using Get Report and print result */
byte mouse0_poll( void )
{
  byte rcode,i;
  char buf[ 4 ] = { 0 };      //mouse buffer
  static char old_buf[ 4 ] = { 0 };  //last poll
    /* poll mouse */
    rcode = Usb.getReport( DEVADDR, 0, 4, 0, 1, 0, buf );
    if( rcode ) {  //error
      return( rcode );
    }
    for( i = 0; i < 4; i++) {  //check for new information
      if( buf[ i ] != old_buf[ i ] ) { //new info in buffer
        break;
      }
    }
    if( i == 4 ) {
      return( 0 );  //all bytes are the same
    }
    /* print buffer */
    if( buf[ 0 ] & 0x01 ) {
      Serial.print("Button1 pressed ");
    }
    if( buf[ 0 ] & 0x02 ) {
      Serial.print("Button2 pressed ");
    }
    if( buf[ 0 ] & 0x04 ) {
      Serial.print("Button3 pressed ");
    }
    Serial.println("");
    Serial.print("X-axis: ");
    Serial.println( buf[ 1 ], DEC);
    Serial.print("Y-axis: ");
    Serial.println( buf[ 2 ], DEC);
    Serial.print("Wheel: ");
    Serial.println( buf[ 3 ], DEC);
    for( i = 0; i < 4; i++ ) {
      old_buf[ i ] = buf[ i ];  //copy buffer
    }
    Serial.println("");
    return( rcode );
}

but i don't get power into my usb mouse.

but i don't get power into my usb mouse.

That has nothing to do with the code, power is transferred by the wiring of your USB socket and is not under program control. What hardware are you using?

I use:
arduino 0020
Arduino Duemilanove
USB Host Shield: (SparkFun USB-C Host Shield - DEV-21247 - SparkFun Electronics)

USB Host Shield Power LED lights up when turn on switch but usb port in shield dosn't give power.

That has nothing to do with the code, power is transferred by the wiring of your USB socket and is not under program control.

I think this turn power on.

Max.powerOn();

but that function doesn't return at all.