Arduino 1.0 and DHT22 library

I tried to set up such a sensor with the library from GitHub - nethoncho/Arduino-DHT22: Arduino library for the DHT22 humidity and temperature sensor. First had to change the inclusion of WConstants.h to Arduino.h since I understood it has changed in recent Arduino versions.
But the example still wont compile, I get these error messages:

In file included from /home/jskata/arduino-1.0/hardware/arduino/cores/arduino/Arduino.h:191,
                 from /home/jskata/arduino-1.0/libraries/DHT22/DHT22.cpp:47:
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:116: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, const char*)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:115: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, const String&)’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:117: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, char)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:116: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, const char*)’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:118: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, unsigned char)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:117: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, char)’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:119: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, int)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:118: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, unsigned char)’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:120: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, unsigned int)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:119: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, int)’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:121: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, long int)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:120: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, unsigned int)’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:122: error: declaration of C function ‘StringSumHelper& operator+(const StringSumHelper&, long unsigned int)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/WString.h:121: error: previous declaration ‘StringSumHelper& operator+(const StringSumHelper&, long int)’ here
In file included from /home/jskata/arduino-1.0/libraries/DHT22/DHT22.cpp:47:
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/Arduino.h:195: error: declaration of C function ‘uint16_t makeWord(byte, byte)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/Arduino.h:194: error: previous declaration ‘uint16_t makeWord(uint16_t)’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/Arduino.h:205: error: declaration of C function ‘long int random(long int)’ conflicts with
/usr/lib/gcc/avr/4.3.5/../../../avr/include/stdlib.h:504: error: previous declaration ‘long int random()’ here
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/Arduino.h:206: error: declaration of C function ‘long int random(long int, long int)’ conflicts with
/home/jskata/arduino-1.0/hardware/arduino/cores/arduino/Arduino.h:205: error: previous declaration ‘long int random(long int)’ here

This is under KUbuntu with an Uno.

First had to change the inclusion of WConstants.h to Arduino.h since I understood it has changed in recent Arduino versions.
But the example still wont compile, I get these error messages:

No. WProgram.h was renamed to Arduino.h.

This post does say it is replaced by Arduino.h: Google Code Archive - Long-term storage for Google Code Project Hosting.

Got it working.
Changed in DHT22.cpp

extern "C" {
#include "WConstants.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
}

into

#include "Arduino.h"
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

Thank you. I have been searching for the solution for most of the night.

I have a problem of showing the temperature and humidity online in a web page. The example bellow works perfectly outputing data to serial doesn't work printing data to web clients. How should I format the output to be usable for html. The temperature and humidity are float types. The way I print now makes the web page to crash and show error on loading.

DHT22_ERROR_t errorCode;
              delay(2000);
              errorCode = myDHT22.readData();
              switch(errorCode)
              {
                case DHT_ERROR_NONE:
                  client.print("<tr><td>Temperature</td><td>D</td><td>");
                  client.print(digitalChannel);
                  client.print("</td><td>");
                  client.write(myDHT22.getTemperatureC());
                  client.print(" C</td></tr>");
                  client.print("<tr><td>Humidity</td><td>D</td><td>");
                  client.print(digitalChannel);
                  client.print("</td><td>");
                  client.write(myDHT22.getHumidity());
                  client.print(" %</td></tr>");
               ....
            }

What values do myDHT22.getTemperatureC() and myDHT22.getHumidity() return. Where I am at the moment, the temperature is 18 degrees C. You are using client.write(), which sends the byte unaltered. If you send ASCII 18 (Device Control 2) to a web-browser, how should it display it?

If you send ASCII 18 (Device Control 2) to a web-browser, how should it display it?

Sending "18" (ASCII 18) should not be a problem. That is NOT what the code is sending, though. It is sending the binary value of 18 to the client. Clients rarely understand what to do with binary data.

OP: You should most likely NOT be using client.write(). You should be using client.print() to send the temperature and humidity as strings.

What's the difference between the ascii character DC2 (0x12, Decimal 18) and binary value 18 (0x12)? I didn't say "18", I said Device Control 2.

What's the difference between

Nothing. I was just trying to point out that print() converts 18 to "18" to send, but that write() does not, in a little less subtle way than you did.

Problem solved. Seems that all it was necessary was a hard reset of the arduino. Afterwards all works fine as for the output.