library error

when I wanna use a new library,I have always a compiletion error such that "No such file".what should I do to finish compiletion

Download the library, and store it in the correct location. Where are you putting the libraries?

what should I do to finish compiletion

Create or download the proper file, in the right place, and restart the IDE.

Quit waving your arms about, and cite specifics, including operating system, if you want detailed instructions.

dxw00d:
Download the library, and store it in the correct location. Where are you putting the libraries?

I put it to libraries folder which is in arduino folder but still I cant compile it

What is the full path?

I copied the .cpp and .h files to C:\Users\robot\Desktop\arduino-1.0\libraries

I execute the program just using the program folder.I didnt setup it.can the problem be about this?

That's the wrong place. See http://arduino.cc/en/Guide/Environment#libraries

I also copied the files to the skectbook according to this site.then when I open the skecth, the .cpp an .h files were also opened.However,still I cant compile,now there are alot of errors about .cpp file.

Then you still have the wrong place.

What is the path to your sketchbook folder?

C:\Users\robot\Documents\Arduino\

If you put the file(s) in the wrong place, the solution is NOT to copy them to the right place. It's to MOVE them.

You still haven't bothered telling us which library or what errors. Guess all you want to do is complain.

Ok. You need add a libraries folder there. So you have C:\Users\robot\Documents\Arduino\libraries.

Inside that folder, you have a folder for each library you download.

If you downloaded, for example, the XBee library, It would go in C:\Users\robot\Documents\Arduino\libraries\XBee.

now I have C:\Users\robot\Documents\Arduino\libraries\adns2620 folder and inside this folder I have adns2620.cpp adns2620 but this error occured "In file included from ADNS2620_Example.cpp:16:
C:\Users\robot\Documents\Arduino\libraries\adns2620/adns2620.h:10:22: error: WProgram.h: No such file or directory"

the code is :

/* ADNS2620 Example Sketch

  • Demonstrates how to use the ADNS2620 Library to interface with the mouse sensor
  • on the ADNS2620 evaluation board from SparkFun Electronics
  • More register definitions are located in the 'adns2620.h' file. Read the
  • ADNS2620 datasheet to understand how to use the registers.
  • After loading the sketch to the ADNS2620 evaluation board, open the serial terminal
  • using a baud rate of 9600 to see the output from the ADNS2620 sensor.
  • Written by Ryan Owens
  • 11/4/10
  • SparkFun Electronics
    */
    //Add the ADNS2620 Library to the sketch.
    #include "adns2620.h"

//Name the ADNS2620, and tell the sketch which pins are used for communication
ADNS2620 mouse(18,19);

//This value will be used to store information from the mouse registers.
unsigned char value=0;

void setup()
{
//Initialize the ADNS2620
mouse.begin();
delay(100);
//A sync is performed to make sure the ADNS2620 is communicating
mouse.sync();
//Put the ADNS2620 into 'always on' mode.
mouse.write(CONFIGURATION_REG, 0x01);

//Create a serial output.
Serial.begin(9600);
}

void loop()
{
//The DELTA_X_REG and DELTA_Y_REG store the x and y movements detected by the sensor

//Read the DELTA_X_REG register and store the result in 'value'
value = mouse.read(DELTA_X_REG);
//Print 'value' to the serial port.
Serial.print("X:");
Serial.print(value, HEX);
Serial.print('\t');

//Read the DELTA_Y_REG register and store the result in 'value'
value = mouse.read(DELTA_Y_REG);
//Print 'value' to the serial port.
Serial.print("Y:");
Serial.println(value, HEX);

delay(10);
}

but this error occured "In file included from ADNS2620_Example.cpp:16:
C:\Users\robot\Documents\Arduino\libraries\adns2620/adns2620.h:10:22: error: WProgram.h: No such file or directory"

And you've spent how much time searching the forum for this error message? Really? That long?

Edit the file, change WProgram.h to Arduino.h, and get ready for a slew of other errors - all of which have ALREADY been posted way too many times.

thank you and sorry about it

If only someone had made a "sticky" about that sort of thing.

Oh wait, they have:

http://arduino.cc/forum/index.php/topic,97455.0.html