In this course, we will see how to solve the problem of compilation. These problems come from your Arduino program: problems of syntax, or problems of libraries

If you have already tried many solutions to solve your problems, you can go the Arduino IDE Editor part.

Problems of compilation or upload?

You have to do the difference between the problems of upload and the problems of compilation. In this course will fix only the problems of compilation. The problems of compilation are from the program: That’s mean that there is an error in the lines of your code or the library. Whereas the problems of upload are from the upload of the program in your Arduino card.

How do I know which problem I have?

In Arduino Ide, you have to click on the verify button. If this one finds an error, you are in the write course. If there isn’t any error, it’s probably an upload problem. We see our course about this subject.

Syntax problems

Problem 1 : Forget a void

This a compilation problem fairly common. In fact, sometimes you don’t need a void setup or void loop in your program. For example, in this program the void setup has been deleted:

By compiling this program, this is the error we obtain:
We can see that the program is not working because it missed the void setup function. In fact, for all the program you will write, you need the void setup and void loop functions even if there is nothing on it.

Problem 2 : Forget a character 

Here is an example of forget a character. In fact, it can be very common to forget a character such as a semi-colon in your program:
Here we can see that we have forgotten a semi-colon on the line pinMode(L1,OUTPUT), and by compiling the program, the software tells us that we have missed a character. Therefore we see that the software help us already.
This the error we got:
If we were forgetting an another characters, the software will help too with another suggestion.

Libraries problems

The libraries are essentials for Arduino: Its permits you to simplify the using of the components thinks to the functions inside.
Nevertheless, the libraries can be hard to use if they not right installed, or deprecated…
In this course we will see the error possible that we can obtain with a library.

Problem 1: The library is not installed

One error can happen when we are in rush, is forget to install the library that your program use. This is the kind of error we have:

With this highlighted in red which is the line of the library:

Solution 1 : You have to install the library

There is in Arduino Ide a Manage Libraries that permits you to keep your libraries up to date and to install new one.

To install the library that you need, you can write the name of the component that you want to use to have the right library.

Solution 2: You can decide to install the library by yourself on Arduino Ide 


To do that, you have to download the library in .zip format.
Then on Arduino Ide, you have to click on sketch, Include Library and Add .zip Library :

Problem 2: Duplication of the  Library

It is possible that you have installed a library two times and the Arduino ide can be lost.
Theses are the kind of error you can have:

multiple definition of `__vector_7′


C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\utility\Adafruit_CPlay_Mic.cpp: In member function ‘int Adafruit_CPlay_Mic::peak(uint16_t)’:
C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\utility\Adafruit_CPlay_Mic.cpp:28:37: error: ‘analogPinToChannel’ was not declared in this scope
channel = analogPinToChannel(4); // Pin A4 to ADC channel
C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\utility\Adafruit_CPlay_Mic.cpp: In member function ‘void Adafruit_CPlay_Mic::capture(int16_t*, uint8_t)’:
C:\Program Files (x86)\Arduino\libraries\Adafruit_Circuit_Playground\utility\Adafruit_CPlay_Mic.cpp:89:37: error: ‘analogPinToChannel’ was not declared in this scope
channel = analogPinToChannel(4); // Pin A4 to ADC channel’

To fix this problem, you have to click in the folder with all the libraries and delete the duplication.
For that, you have to click on document, click on the folder Arduino and libraries. Here you have the list of the libraries. You can delete the duplication.

Problem 3 : Installation of a deprecated library

This is an example of a deprecated library: We can see that there are new files after the version 1.0. This library needs to be updated.

In file included from capture_relai.cpp:1: D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:14:20: error: wiring.h: No such file or directory In file included from capture_relai.cpp:1: D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:59: error: variable or field ‘vw_set_tx_pin’ declared void D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:59: error: ‘uint8_t’ was not declared in this scope D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:63: error: variable or field ‘vw_set_rx_pin’ declared void D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:63: error: ‘uint8_t’ was not declared in this scope D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:67: error: variable or field ‘vw_set_ptt_pin’ declared void D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:67: error: ‘uint8_t’ was not declared in this scope D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:71: error: variable or field ‘vw_set_ptt_inverted’ declared void D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:71: error: ‘uint8_t’ was not declared in this scope D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:76: error: variable or field ‘vw_setup’ declared void D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:76: error: ‘uint16_t’ was not declared in this scope D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:95: error: ‘uint8_t’ does not name a type D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:101: error: ‘uint8_t’ does not name a type D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:104: error: ‘uint8_t’ does not name a type D:\arduino\arduino-1.0\libraries\VirtualWire/VirtualWire.h:109: error: ‘uint8_t’ does not name a type capture_relai.cpp: In function ‘void setup()’: capture_relai:12: error: ‘vw_set_ptt_inverted’ was not declared in this scope capture_relai:13: error: ‘vw_setup’ was not declared in this scope capture_relai:14: error: ‘vw_set_tx_pin’ was not declared in this scope capture_relai.cpp: In function ‘void loop()’: capture_relai:23: error: cannot convert ‘float’ to ‘const char*’ in initialization capture_relai:25: error: ‘vw_send’ was not declared in this scope

It is possible that the library you use is deprecated because you are using an old version of Arduino IDE. To fix this problem you have to click on sketch and manage libraries:
In this page you can see which library needs to be updated :

We see that the Bridge library needs to be udapted.

Last solution Bonus : don’t use the library

If you have some difficulties to install a library or maybe you don’t want to use it you can follow this part !
To do that, you have to add some lines of code that you need.
We will see an example that we have done in the course stepper motor in which we have replaced the library.

This the program with the library :

#include <Stepper.h> 
const int stepsPerRevolution = 2048; // To modify to corresponds to the right number of step by tour 
const int stepPerMinute = 15; // The plage of step is from 0 to 17
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11); // initialization of pins stepper motor

void setup(){

void loop(){
    myStepper.step(stepsPerRevolution); // in a direction
    myStepper.step(-stepsPerRevolution); // in an another direction

This is the first lines we have to add to avoid the library (We define the pins we will use to control the component) :

#define IN1 8
#define IN2 9
#define IN3 10
#define IN4 11

We declare the variable for the direction of the motor and the number of steps:

int Steps = 0;
boolean Direction = true;
unsigned long last_time;
unsigned long currentMillis ;
int steps_left=4095;
long time;

Finally, we declare the output pins to control the component:

pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);

Antivirus issue

Another problem is your antivirus which block the access of the folder that Arduino Ide need to verify your program. You will see an error about the problem of access as you can see:

“Arduino : 1.8.0 (Windows 10), Carte : “Arduino/Genuino Uno” c:\users\julien\desktop\arduino\arduino-1.8.0\hardware\tools\avr\bin../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename ‘core\core.a’; reason: Permission denied exit status 1 Erreur de compilation pour la carte Arduino/Genuino Uno Ce rapport pourrait être plus détaillé avec l’option “Afficher les résultats détaillés de la compilation” activée dans Fichier -> Préférences.”

To fix the error, you have many solutions:

Solution 1: Disable your antivirus

You can try to disable or to make an exception to this software.

Solution 2 : Permission access denied

You have maybe some problems with the permissions of the folder. To fix that, you can check the permissions to update it.


Finally, if nothing is working, you can re-install Arduino Ide because you can have a problem with the compilator.

Arduino Ide Editor Online

If your problem with Arduino Ide is not resolved, you can use an online version of Arduino Ide. In fact, Arduino Ide is installed on a different computers, maybe it doesn’t work everywhere properly. That’s why you can use an online editor of Arduino Ide.

This editor offer all the options that the one you have downloaded, but because it’s host by the Arduino website, you won’t compatibility problem.

This is the link of the editor :  Arduino Ide

Once the account created, this is what we have:

First, you can import the program you want to compile. You have to export your program from Arduino Ide in a .zip file and adding in it a folder « Libraries » and put all the libraries you need for your program :

If you click on yes you will see your imported program:

Here is your imported program. On the top, you have the save button and verify. Thanks to this you can compile your program online.
You add a library manually by clicking on Librairies:

A list of library is already installed and if you don’t find yours, you can install it on the Library Manager:

Une fois le logiciel téléchargé, il vous faut suivre les étapes :

With Arduino Ide online, you can also upload your program on your arduino card. To do that you have to download a software:

This software makes the link between your arduino card and the Arduino editor online. You can find the software at this link.

One the software donwloaded, you have to follow theses steps:

After accepting the agreement, it will ask you if you want to use the software with an anoter web browser than the one you are currently using:

Once the software installed, we can go back to Arduino ide online editor to upload your program.


We hope this course helped you to fix your compile problem. Don’t hesitate to look at our course about upload problem if this problem appears after compiling your program.