Compilation Error Messages

Before I begin I need to explain that while I am a skilled engineer I am a Complete NOOB at writing sketches for the Arduino
is there a list of error messages returned on failed compilation in the 1.0 ide?
in 'attempting' to compile the sketch from the Playground DHT11 test I get the error message 'dht11' does not refer to a type
n 'attempting' to compile the sketch from Adafruit (1.8" display) graphicstest.pde I get the error message 'Adafruit_ST7735' does not refer to a type.
What am I doing wrong?


You are not reading the sticky post at the top of the list. All is explained there.

Mike is referring to Read this before posting a programming question

Thank you one and all for your kind, thoughtful and prompt responses. I am not lazy I do read all I can find and if I could have found the answer on my own, I would have and saved myself from the same ridicule offered most of the inmates in this asylum. If I can't figure it out with the great answers offered here then probably I didn't need to build it after all...

If I can't figure it out with the great answers offered here then probably I didn't need to build it after all...

So, was there some part of "Post your code" that you have trouble understanding?

If I can't figure it out with the great answers offered here then probably I didn't need to build it after all...

I feel I understand your pain.

Have you included the header file in your sketch? Have you placed the library in your libraries folder?

It is probably best if you post what you are attempting to compile. (And place it between the code tags before you get jumped on).

good luck

I used the sketch, CPP and header files provided, without modification for the DHT11 library. I had exactly the same issue with a sketch provided from the Adafruit website again without modification, I got the same error message........ So in the interest of brevity...... I opted not to re-post what was/is already there... but since it is necessary to solve my dilemma here it is.
this returns "DHT11 does not name a type" and I can't find any relevant help in an hour or so of searching

//   FILE:  dht11_test1.pde
// PURPOSE: DHT11 library test sketch for Arduino

//Celsius to Fahrenheit conversion
double Fahrenheit(double celsius)
	return 1.8 * celsius + 32;

//Celsius to Kelvin conversion
double Kelvin(double celsius)
	return celsius + 273.15;

// dewPoint function NOAA
// reference: 
double dewPoint(double celsius, double humidity)
	double A0= 373.15/(273.15 + celsius);
	double SUM = -7.90298 * (A0-1);
	SUM += 5.02808 * log10(A0);
	SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;
	SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;
	SUM += log10(1013.246);
	double VP = pow(10, SUM-3) * humidity;
	double T = log(VP/0.61078);   // temp var
	return (241.88 * T) / (17.558-T);

// delta max = 0.6544 wrt dewPoint()
// 5x faster than dewPoint()
// reference:
double dewPointFast(double celsius, double humidity)
	double a = 17.271;
	double b = 237.7;
	double temp = (a * celsius) / (b + celsius) + log(humidity/100);
	double Td = (b * temp) / (a - temp);
	return Td;

// #include <Arduino.h> //made no difference in the compiler error message returned
#include <dht11.h>

dht11 DHT11; // [color=red]this is I think where the error is..[/color]
#define DHT11PIN 2

void setup()
  Serial.println("DHT11 TEST PROGRAM ");
  Serial.print("LIBRARY VERSION: ");

void loop()

  int chk =;

  Serial.print("Read sensor: ");
  switch (chk)
    case 0: Serial.println("OK"); break;
    case -1: Serial.println("Checksum error"); break;
    case -2: Serial.println("Time out error"); break;
    default: Serial.println("Unknown error"); break;

  Serial.print("Humidity (%): ");
  Serial.println((float)DHT11.humidity, 2);

  Serial.print("Temperature (oC): ");
  Serial.println((float)DHT11.temperature, 2);

  Serial.print("Temperature (oF): ");
  Serial.println(Fahrenheit(DHT11.temperature), 2);

  Serial.print("Temperature (K): ");
  Serial.println(Kelvin(DHT11.temperature), 2);

  Serial.print("Dew Point (oC): ");
  Serial.println(dewPoint(DHT11.temperature, DHT11.humidity));

  Serial.print("Dew PointFast (oC): ");
  Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity));


I was able to get a BMP085 sensor to work very well. All the returned data from it was well within the manufacturer's published spec
once I got it interfaced properly. I was also hoping to get a 1.8" graphic LCD working to graph the humidity data from the DHT11
and the temp and baro information from the BMP085 and a clock...... all to an sd card for storage.
This I thought would be a great way to get some experience for other things I want to build. I am a retired electronics engineer and the
Arduino looked like a great platform from which to start...


1 Like

As you have the example sketch, I presume you have downloaded the DHT11 library. Where have you put the library files?

AgeingHippy, I was 18 in 1964, I remember the time very well. Thank you for the kind response. I did all that was suggested... In the information about the DHT11 sketch I was reminded again to place the .h and .CPP files in a library folder in the Arduino library directory.


Downloaded libraries should go in a Libraries subdirectory, in your sketchbook directory, not in the Arduino software directory.

Hey Doc

I have installed the library and it compiles fine.

So, you need to create a dht11.h file and dht11.cpp file, placing both in your relevan library older.

I used

Restart your IDE (not sure if this step is necessary) and then try the example sketch again.

I suspect your library header and body files are in the wrong place.

Strictly speaking, that is the wrong place, as I said above. If you put libraries in the recommended location, it means they are not affected by possible future changes to the IDE, and are available globally, if you have multiple IDE versions installed.

Hey dxw00d

Do you mean in the C:\Users<myUserName>\Documents\Arduino directory for example? Creating a libraries folder in this directory and placing the libraries there?

I have found I needed to copy certain libraries to my new library folder when upgrading to v1.0, but I also had to change references to Wprogram.h to Arduino.h. (I know one can put a precompiler directive to select based on the version...)

That would be the recommended location. So you could have, for example C:\Users<myUserName>\Documents\Arduino\Libraries\DHT11 and that would contain the .cpp and .h files.

Nice one

Thanks dxw00d

Doc, If you have the files in the correct folders and it still does not work I suggest you check the file contents and extension closely. Is it possible you named the dht11.cpp dht11.ccp instead for example?

When I misname the dht11 body file I get the following errors

sketch_may07c.cpp:53:19: error: dht11.h: No such file or directory
sketch_may07c:47: error: 'dht11' does not name a type
sketch_may07c.cpp: In function 'void setup()':
sketch_may07c:55: error: 'DHT11LIB_VERSION' was not declared in this scope
sketch_may07c.cpp: In function 'void loop()':
sketch_may07c:63: error: 'DHT11' was not declared in this scope

No I rechecked the thing both the .h and .cpp files reside in C:/Users/End User/Arduino\libraries/DHT11... The only thing I haven't done was to exit the IDE and - restart the IDE - reload and attempt to re-compile.
If that works ALL will see my apologies in caps.

This is the line that the compiler chokes on (is highlighted in yellow)
dht11 DHT11;
Returns, 'DHT11' Does Not Name a Type and the context sensitive help only says "No Information on DHT11"


thing I haven't done was to exit the IDE and - restart the IDE - reload and attempt to re-compile.

Yep that is what you need to do.

Well Another Foolish OLD MAN'S MISTAKE... I Have the header and cpp files from the "OTHER DHT???" I need to go find and remove all the dht stuff and get a correct and COHERENT set of files and try again.
Thank you one and all for your efforts, it wasn't until I looked at the version numbers that I found my mistake.



With the "RIGHT" Files IN the "RIGHT" PLACES... the sketch compiles perfectly... Now the trick is to make it perform as I need it to.

AGAIN, THANK YOU ONE AND ALL. For being patient with me. I think most of all to 'Grumpymike' and 'Oldhippie'


Last message... On This Topic... It Works well, after I eliminated the DHT22 stuff /* Blah, B...*/... Now for the Clock