winlinvip / SimpleDHT

Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht
MIT License
145 stars 61 forks source link

undeclared functions when compiling for non-AVR boards #24

Closed christandlg closed 6 years ago

christandlg commented 6 years ago

when compiling for ESP8266 or ESP32 (others propably too) compilation fails with the following error:

C:\Users\user\Documents\Arduino\libraries\SimpleDHT\SimpleDHT.cpp:72:27: error: no 'int SimpleDHT::getBitmask()' member function declared in class 'SimpleDHT'

int SimpleDHT::getBitmask() {

                       ^

C:\Users\user\Documents\Arduino\libraries\SimpleDHT\SimpleDHT.cpp:76:24: error: no 'int SimpleDHT::getPort()' member function declared in class 'SimpleDHT'

int SimpleDHT::getPort() {

                    ^

this is because the function definitions of SimpleDHT::getBitmask() and SimpleDHT::getPort() are not enclosed within a conditional compilation block, unlike their declarations in SimpleDHT.h

paulocotta commented 6 years ago

I also had the same problem

int SimpleDHT::getBitmask() { int SimpleDHT::getPort() {

rolfbachmann commented 6 years ago

Had the same problem too. Downgrade to 1.0.8 works for me.

winlinvip commented 6 years ago

@rolfbachmann Please test 1.0.12