DHT22 Example Compiling Error

Our range of tiny modules are designed to make it easy for you to quickly add functionality to your projects. [Module List]
Post Reply
Infra
Posts: 2
Joined: Sat Apr 28, 2012 2:54 am

DHT22 Example Compiling Error

Post by Infra » Sat Apr 28, 2012 3:35 am

Hi

I am very new to Arduino, and prehaps I am trying to run before walking. I bought myself a DHT22 temp & humidity sensor, ive wired it up as per the tutorial, but when I come to compiling the example programming, I get the follow error popping up;

In file included from DHTtester.cpp:4:
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:2:22: error: WProgram.h: No such file or directory
In file included from DHTtester.cpp:4:
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:20: error: 'uint8_t' does not name a type
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:21: error: 'uint8_t' does not name a type
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:22: error: 'boolean' does not name a type
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:24: error: 'boolean' does not name a type
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:27: error: expected `)' before 'pin'
DHTtester.pde:-1: error: no matching function for call to 'DHT::DHT(int, int)'
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:18: note: candidates are: DHT::DHT()
D:\Arduino\arduino-1.0\libraries\DHT/DHT.h:18: note: DHT::DHT(const DHT&)


I followed the instructions in the readme in the placement of the files.

eg: D:\Arduino\arduino-1.0\libraries\DHT

and files within the folder

Directory of D:\Arduino\arduino-1.0\libraries\DHT

28/04/2012 03:29 p.m. <DIR> .
28/04/2012 03:29 p.m. <DIR> ..
28/04/2012 02:45 p.m. 2,957 DHT.cpp
28/04/2012 02:46 p.m. 530 DHT.h
28/04/2012 03:29 p.m. 0 dir.txt
28/04/2012 02:45 p.m. <DIR> examples
28/04/2012 02:46 p.m. 410 README.txt
4 File(s) 3,897 bytes
3 Dir(s) 30,309,081,088 bytes free

Can anyone please shed any light on what I have done wrong ?

Cheers

Tony.

Infra
Posts: 2
Joined: Sat Apr 28, 2012 2:54 am

Re: DHT22 Example Compiling Error

Post by Infra » Sat Apr 28, 2012 3:50 am

Hi

Dissregard my post, feel like a right noob now, seeing that it has been coverd before, now having it working with new coding.

Cheers

FearTec
Posts: 2
Joined: Mon Dec 23, 2013 8:55 pm

Re: DHT22 Example Compiling Error

Post by FearTec » Mon Dec 23, 2013 8:58 pm

Care to share the code

I get this error when compiling











DHTtester.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Program Files (x86)\Arduino/DHTtester.pde:13: undefined reference to `DHT::DHT(unsigned char, unsigned char)'
DHTtester.cpp.o: In function `loop':
C:\Program Files (x86)\Arduino/DHTtester.pde:25: undefined reference to `DHT::readHumidity()'
C:\Program Files (x86)\Arduino/DHTtester.pde:26: undefined reference to `DHT::readTemperature(bool)'
DHTtester.cpp.o: In function `setup':
C:\Program Files (x86)\Arduino/DHTtester.pde:19: undefined reference to `DHT::begin()'

FearTec
Posts: 2
Joined: Mon Dec 23, 2013 8:55 pm

Re: DHT22 Example Compiling Error

Post by FearTec » Mon Dec 23, 2013 9:23 pm

I found my problem I was saving to the wrong libraries folder.

Ready my blog post here
http://simon.fearby.com/blog/?p=1937

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: DHT22 Example Compiling Error

Post by angusgr » Sun Dec 29, 2013 10:08 pm

Hi Simon,

Thanks for the heads-up on the library path not being properly explained. I've added links to our "How to Install Arduino Libraries" guide from the DHT library page and the quickstart page, and I've given that How To guide a bit of a freshen up as well.

Hope you enjoy the DHT sensor.

- Angus

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests