The ClientConstructor Example Does Not Seem To Compile

Hi Everyone:

I have a Mega with an Ethernet Shield running in "Client" mode using a static IP to address a "server". (Version 1.0.1) The code runs very well, except I would like to address the server by name.

As I began looking into this, I decided to cut and paste this code to play around with it.


I can NOT figure out what I am doing wrong; but, this code just will not compile for me. When I look at the .h files, I agree with the compiler errors. I tried running this under 1.0.1 and 1.0... with essentially the same results.

Any thoughts would be greatly appreciated.



The first error I got with that code was “Client is now called EthernetClient”. Perhaps using the example for EthernetClient would work better:

It looks very similar to the Client code except (server, 80) moved from the Client constructor to the client.connect() call. This allows a single Client instance to connect to different servers at different times.

#include <Ethernet.h>
#include <SPI.h>

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

EthernetClient client;

void setup()
  Ethernet.begin(mac, ip);



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

void loop()
  if (client.available()) {
    char c =;

  if (!client.connected()) {

Hi John:

This makes sense... I missed the first error message.

Thanks for taking a look.