# Erreur compilation arduino

**URL:** <https://forum.arduino.cc/t/erreur-compilation-arduino/1370393>\
**Category:** Français\
**Created:** [April 4, 2025, 12:59pm UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393 "2025-04-04T12:59:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![manonpou](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/manonpou/32/1126438_2.png) [@manonpou](https://forum.arduino.cc/u/manonpou)\
**Post date:** [April 4, 2025, 12:59pm UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/1 "2025-04-04T12:59:39Z")

</div>

Bonjour, j'utilise la carte Arduino Mega 2560, et lors de la compilation j'ai reçu ce message d'erreur (assez long) :

libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `ServoCount'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `\_\_vector\_17'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `\_\_vector\_32'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `\_\_vector\_42'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `\_\_vector\_47'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::Servo()'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::Servo()'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::attach(int, int, int)'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::attach(int)'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::detach()'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::writeMicroseconds(int)'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::write(int)'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::readMicroseconds()'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::read()'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `Servo::attached()'  
sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here  
collect2.exe: error: ld returned 1 exit status  
exit status 1  
Erreur de compilation pour la carte Arduino Mega or Mega 2560

Quelqu'un comprend-t-il d'où vient le problème et peut-il m'apporter une solution ?  
Merci d'avance

---

<div class="post-metadata">

**Author:** ![fdufnews](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/fdufnews/32/238836_2.png) [@fdufnews](https://forum.arduino.cc/u/fdufnews)\
**Post date:** [April 4, 2025, 1:10pm UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/2 "2025-04-04T13:10:26Z")

</div>

> [@manonpou](#):
>
> libraries\Servo\avr\Servo.cpp.o (symbol from plugin): In function `ServoCount': (.text+0x0): multiple definition of `ServoCount'  
> sketch\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here

La librairie Servo.cpp serait présente dans 2 répertoires:

- libraries\Servo\avr\Servo.cpp.
- sketch\Servo.cpp

Tu n'aurais pas copié les fichiers de la librairie dans le répertoire contenant ton sketch par hasard?

---

<div class="post-metadata">

**Author:** ![manonpou](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/manonpou/32/1126438_2.png) [@manonpou](https://forum.arduino.cc/u/manonpou)\
**Post date:** [April 4, 2025, 1:21pm UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/3 "2025-04-04T13:21:22Z")

</div>

J'ai beau chercher mais je ne vois qu'un seul répertoire où se trouve ma librairie Servo.cpp .

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [April 5, 2025, 7:05am UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/4 "2025-04-05T07:05:35Z")

</div>

Avez vous 2 .ino dans votre répertoire de travail ?

Montrez nous ce qu’il y a dans votre répertoire du sketch ainsi que le code que vous utilisez.

---

<div class="post-metadata">

**Author:** ![manonpou](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/manonpou/32/1126438_2.png) [@manonpou](https://forum.arduino.cc/u/manonpou)\
**Post date:** [April 5, 2025, 8:33am UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/5 "2025-04-05T08:33:40Z")

</div>

Bonjour, dans mon répertoire, il n'y a que mon sketch et les deux librairies que j'utilise (qui sont uniquement dans ce répertoire et nulle part ailleurs). Je joint ci-dessous une capture d'écran de mon répertoire afin que vous puissiez constater par vous-même.

 ![capture_problème_arduino](https://europe1.discourse-cdn.com/arduino/original/4X/c/1/a/c1aa49ba9dc7661c397ec1d5c3bfd015d5b68102.jpeg)

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [April 5, 2025, 8:36am UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/6 "2025-04-05T08:36:59Z")

</div>

virez Servo.h et Servo.cpp de votre répertoire. La bibliothèque est rangée dans le répertoire des bibliothèques partagées (libraries\Servo\avr)

---

<div class="post-metadata">

**Author:** ![manonpou](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/manonpou/32/1126438_2.png) [@manonpou](https://forum.arduino.cc/u/manonpou)\
**Post date:** [April 5, 2025, 9:20am UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/7 "2025-04-05T09:20:28Z")

</div>

Merci, c'était en effet cela le problème, ça marche mieux maintenant.

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [April 5, 2025, 10:42am UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/8 "2025-04-05T10:42:48Z")

</div>

c'est @fdufnews qui avait vu juste !

je marque son post en solution.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 2, 2025, 10:42am UTC](https://forum.arduino.cc/t/erreur-compilation-arduino/1370393/9 "2025-10-02T10:42:54Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
