Problems in uploading sketch using Platformio on Ubuntu

Hello,
I am using platformio as IDE for Arduino. I followed this link to run a sketch and it was successfully uploaded in A. Leonardo.
When I started the IDE again, I still have problems uploading the sketch:

Processing leonardo (platform: atmelavr; board: leonardo; framework: arduino)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/leonardo.html
PLATFORM: Atmel AVR (3.0.0) > Arduino Leonardo
HARDWARE: ATMEGA32U4 16MHz, 2.50KB RAM, 28KB Flash
DEBUG: Current (simavr) On-board (simavr)
PACKAGES:
 - framework-arduino-avr 5.1.0
 - tool-avrdude 1.60300.200527 (6.3.0)
 - toolchain-atmelavr 1.50400.190710 (5.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 5 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Linking .pio/build/leonardo/firmware.elf
.pio/build/leonardo/src/main.cpp.o (symbol from plugin): In function `setup':
(.text+0x0): multiple definition of `setup'
.pio/build/leonardo/src/colorReader.cpp.o (symbol from plugin):(.text+0x0): first defined here
.pio/build/leonardo/src/main.cpp.o (symbol from plugin): In function `setup':
(.text+0x0): multiple definition of `loop'
.pio/build/leonardo/src/colorReader.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
*** [.pio/build/leonardo/firmware.elf] Error 1
========================== [FAILED] Took 1.09 seconds ==========================

What might be wrong?
How can I set the board once and for all?
Thank you