How to clean Arduino IDE?

Arduino is trying to compile files that no longer exist in my user library (Arduino\libraries\keybrd).
I deleted all the AppData\Local\Temp\build...tmp folders.
What is the proper way to clean Arduino IDE?

Thank you.

I use to use a special 'spray and wipe' with a very wet cloth, but that didn't always fix the problems. :stuck_out_tongue:
So, then I stopped using the Arduino IDE and started using Eclipse, which is just perfect for many years now.

But serioulsy, you must still be referencing those files in your project somewhere, maybe as include files, or as includes of included files. As far as I know, you don't need to do anything, just keep your project tidy and organised.

Still, you don't mention what operating system you are using, or what version of Arduino IDE you are using.


Paul

Hi Paul.

I am running Arduino 1.0.6 on Windows 7.
I have reduced the project to two files.

The main ino file:

#include <k_Key_1.h>

k_Key_1	k;

void setup() { }
void loop() { }

Arduino\libraries\keybrd\k_Key_1.h

#ifndef K_KEY_1_H
#define K_KEY_1_H
#include <Arduino.h>
#include <inttypes.h>

class k_Key_1 { };
#endif

compile error message:

C:\Users\wolf\Documents\Arduino\libraries\keybrd\l_Key_Layered.cpp:
 In member function 'virtual void l_Key_Layered::press()':
C:\Users\wolf\Documents\Arduino\libraries\keybrd\l_Key_Layered.cpp:6:
 error: invalid use of incomplete type 'struct c_LayerManager'
C:\Users\wolf\Documents\Arduino\libraries\keybrd\/c_Code.h:4:
 error: forward declaration of 'struct c_LayerManager'

These files have been deleted from the library.

Right, that's better information.

Some thoughts;
I'm thinking your compiler is doing an incremental compile.
Why I say this is because I understand you were using these files before, and they were part of the compile process. Then you deleted these other files.

If this is possible with the Arduino IDE, I am not sure, and somebody else here will know, but, you can get around it by deleting everything in your project folder except your present source files and re-compiling.

Or, you can also try to create a new project and just copy those present source files across to the new project.
The result of both choices should be the same for you.

If after that you still have the problem, then I would be a tad stuck.


Paul

rockwallaby:
try to create a new project and just copy those present source files across to the new project.


Paul

I tried that, with similar results. I don't think its the project. Arduino IDE seems to be looking at an old version of the user library (Arduino\libraries\keybrd).

Just replace with

#include "k_Key_1.h"

from

#include <k_Key_1.h>

Hi AMPS,

I replaced the include angle brackets with quotes as you suggested, but it didn't make a difference.
k_Key_1.h is in the user library, so it should work with either way.

The user defined header files are totally different in case of arduino. If you wanted to use

#include<xxx.h>like this you should create library first. Then include in folder name library in arduino folder with same file name. Here you can use as <> format.

If you using only for single program prospective you should define header file in ""

I created a library folder and added it to the library:
Arduino IDE > Sketch > Import Library... > Add Library... > Arduino\libraries\keybrd

And then copied the k_Key_1.h file to the library Arduino\libraries\keybrd\

And included the file in the main ino file:

#include <k_Key_1.h>

Is it good practice to have multiple classes in a file?
The library tutorial does not define what a library is and does not say if there should be just one class per library folder. http://arduino.cc/en/Hacking/LibraryTutorial
I have been copying multiple classes into each library and that was working fine for a long time.

Hi AMPS-N,
I saved k_Key_l.h in the sketch folder and put include "k_Key_1.h" in quotes and got the same error.
Three zip files are attached :

  • kb.zip for the kb library, which contains 3 files
  • kb_L.zip for the kb_L library, which contains 2 files
  • sketch.zip for the sketch folder, which contains test_error.ino and k_Key_1.h
  • error.png is a screen shot of the error message.

Keep in mind that k_Key_1.h is intended to be in the kb library, not the sketch folder.

Thank you for looking into this.

kb.zip (928 Bytes)

kb_L.zip (641 Bytes)

test_error.zip (1.28 KB)

I recreated the error in a new library using the files attached in the previous post.
I am running Arduino 1.0.6 on Windows 7.
The following steps should recreate the error on a similar system.

Create two Arduino libraries:
Arduino\libraries\kb
Arduino\libraries\kb_L\

Add the libraries to the Arduino IDE:
Sketch > Import Library... > Add Library... >

Copy these files into Arduino\libraries\kb:
k_Key_1.h
l_Key_Layered.cpp
l_Key_Layered.h

Copy these files into Arduino\libraries\kb_L:
c_LayerManager.cpp
c_LayerManager.h

Compile test_error.ino (compile error is displayed).

The code can be made to compile by adding an include.
In file test_error.ino, "#include <c_LayerManager.h>"

After test_error.ino compiles, Arduino has the c_LayerManager object file and no longer needs the "#include <c_LayerManager.h>".
To repeat the error again, delete your temporary build e.g. AppData\Local\Temp\build574758465065038380.tmp
Close Arduino IDE, reopen test_error.ino in Arduino IDE, comment "#include <c_LayerManager.h>", and compile.

just clear your temprory file & try to upload again. if error persist update ur IDE itself