Platformio teensy project - is included and should not be

I have a teensy project that was compiling and running but something I did now causes to be compiled causing a duplicate setup() and loop() method. I trying to find out where the dependency is and how to remove it. Is there a way to view the makefile or any suggestion on how to track down why is being included? Thanks

.pio/build/teensy41/libFrameworkArduino.a( In function setup': multiple definition of setup’
.pio/build/teensy41/src/main.cpp.o:main.cpp:(.text.setup+0x0): first defined here
/home/greaterebiz/.platformio/packages/toolchain-gccarmnoneeabi/bin/…/lib/gcc/arm-none-eabi/5.4.1/…/…/…/…/arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions

If is in src or in the framework files or in a folderi n lib/ and not excluded by src_filter → it is compiled. There does not need to be a dependency declared on it.

Based on your error message, and main.cpp conflict. Remove one of them.

That’s the rub, I cannot find or any file remotely named blink in src or lib folders - even looking for hidden files.

It’s possible that this has somehow gotten into the Arudino framework. Open a CLI and do a rm -rf ~/.platformio/packages/framework-arduinoteensy* to remove all existing Arduino-Teensy packages, then rebuild (framework will be redownloaded).

Ok, i was able to delete the framework-arduinoteensy stuff and as you say when I recompile, it reloades the framework but then I still get the problem

Processing teensy41 (platform: teensy; board: teensy41; framework: arduino)
Tool Manager: Installing platformio/framework-arduinoteensy @ ~1.155.0
Unpacking  [####################################]  100%          
Tool Manager: framework-arduinoteensy @ 1.155.0 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Teensy (4.14.0) > Teensy 4.1
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 7.75MB Flash
DEBUG: Current (jlink) External (jlink)
 - framework-arduinoteensy 1.155.0 (1.55) 
 - tool-teensy 1.155.0 (1.55) 
 - toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 96 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <RF24> 1.4.1
|   |-- <SPI> 1.0
|-- <EEPROM> 2.0
|-- <Teensy4 I2C> 1.1.0
Building in release mode
Linking .pio/build/teensy41/firmware.elf
.pio/build/teensy41/libFrameworkArduino.a( In function `setup': multiple definition of `setup'
.pio/build/teensy41/src/main.cpp.o:main.cpp:(.text.setup+0x0): first defined here
/home/greaterebiz/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld: Disabling relaxation: it will not work with multiple definitions
collect2: error: ld returned 1 exit status
*** [.pio/build/teensy41/firmware.elf] Error 1
======================================================= [FAILED] Took 4.21 seconds =======================================================
The terminal process "platformio 'run

I think I found it was in the framework-ardinoteensy/cores/teens4 folder. Renaming it solved the problem.

Okay that’s weird, I have the same file in my framework-arduinoteensy folder – I’ll check if building fails for me.

This file is also included in the build for me

Compiling .pio\build\teensy40\FrameworkArduino\

but compilation results in a success instead of an error… weird magic. I’ll open an issue about this.

You were a big help - thanks!

This is now tracked in cores/teensy/ causes build failure for some machines · Issue #82 · platformio/platform-teensy · GitHub, please participate in there if question arise.