Sketch using Ethernet shield

I'm just learning about Arduino and specifically the Ethernet library and the DHCP library I downloaded. I thought I'd copied the example of this script correctly, but i keep getting errors such as:

In file included from DHCP_Test.cpp:9:
C:\Users\Impresario\Documents\Arduino\arduino-0022\libraries\DHCP/Dhcp.h:8:29: error: utility/types.h: No such file or directory
In file included from DHCP_Test.cpp:9:
C:\Users\Impresario\Documents\Arduino\arduino-0022\libraries\DHCP/Dhcp.h:120: error: 'u_char' does not name a type
C:\Users\Impresario\Documents\Arduino\arduino-0022\libraries\DHCP/Dhcp.h:121: error: 'u_char' does not name a type

Here is the short sketch. I would be ever so grateful for any help!

#if ARDUINO > 18
#include <SPI.h>
#endif
#include <Client.h>
#include <Ethernet.h>
#include <Server.h>
#include <Udp.h>

#include "Dhcp.h"

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x50, 0xDD };
// IP addressing automatic
byte server[] = { 209, 85, 229,104}; // Google

Client client(server, 80);

void setup()
{
Serial.begin(9600);
if(Dhcp.beginWithDHCP(mac) == 1) // begin method returns 1 if successful
{
Serial.println("got IP address, connecting...");
delay(5000);
}
else
{
Serial.println("unable to acquire ip address!");
while(true) ; // do nothing
}

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(;:wink: ;
}
}

1, Use The code tages to display code /\ the # symbol above.

C:\Users\Impresario\Documents\Arduino\arduino-0022\libraries\DHCP/Dhcp.h:8:29: error: utility/types.h: No such file or directory
In file included from DHCP_Test.cpp:9:

Simple question - does the file utility/types.h file exist in the libraries folder?

If it doesn't or its not recognised then that may be the reason for the other issues.

No, the utility/types.h file is nowhere to be found and I did recognize this as the core issue. I guess I wonder where to get that from and why it wouldn'd have been part of the DHCP library that called for it.

Thanks for responding!

I guess I wonder where to get that from and why it wouldn'd have been part of the DHCP library that called for it.

Where did you get your DHCP library? Where did you put the contents?

It came the jordan.terrell blog called Arduino DHCP Library V0.4 (just now realized the entry is labedl April 2009, so it may be dated). I moved it into the arduino-0022\library.

Here's a hint. When someone asks you where you got something, they mean for you to post a URL, not a vague description of a site.

Sorry:

http://blog.jordanterrell.com/post/Arduino-DHCP-Library-Version-04.aspx

I am having the same issue. I am using the same version of Arduino (022) and the same version of Jordan Terrell's DHCP library.

This is a little dated library, but is seems that there is not a lot out there. Any help would be appreciated.

I am having the same issue. I am using the same version of Arduino (022) and the same version of Jordan Terrell's DHCP library.

On that site:

Update 7/3/2011: This library no longer works with current builds of Arduino. At some point in the future I may decide to create a new revision, but my current focus is not on Arduino development.

The below link has code that works with IDE 0021:

http://gkaindl.com/software/arduino-ethernet

Thanks zoomkat! That link to the library is functional with the latest version of Arduino (022). I downloaded and installed the library and ran the example included with the DHCP library and everything compiled and ran without modification.