Search code examples
visual-studio-codearduinoplatformio

Platform IO :undefined reference to `init'/[.pio\build\uno\firmware.elf] Error 1


I use visual studio code for programing arduino uno using platform io. But when I build my code there is no mistake I seen on problem. there is no error script on there. but on terminal says like this:

Executing task: C:\Users\ridho.platformio\penv\Scripts\platformio.exe run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)

Verbose mode can be enabled via -v, --verbose option

CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html

PLATFORM: Atmel AVR 2.1.0 > Arduino Uno

HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash

DEBUG: Current (simavr) On-board (simavr)

PACKAGES:

  • framework-arduino-avr 5.0.0

  • toolchain-atmelavr 1.50400.190710 (5.4.0)

LDF: Library Dependency Finder ->

LDF Modes: Finder ~ chain, Compatibility ~ soft

Found 6 compatible libraries

Scanning dependencies...

No dependencies

Building in release mode

Linking .pio\build\uno\firmware.elf

C:\Users\ridho\AppData\Local\Temp\ccrKx04Q.ltrans0.ltrans.o: In function main': ***<artificial>:(.text.startup+0x0): undefined reference toinit'* collect2.exe: error: ld returned 1 exit status ****** [.pio\build\uno\firmware.elf] Error 1* ==================================================== [FAILED] Took 1.43 seconds ==================================================== The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

I assume that the main problem is : undefined reference to `init' or*** [.pio\build\uno\firmware.elf] Error 1

I have read all same problem like this ask in platform io community ,and professional said that the solution is disable any antivirus. I just have kaspersky antivirus on my pc. I also disable win defender,win firewall. but when I build again. still same. anyone can help me?

this my antivirus that have been disabled by me: this image by clicking


Solution

  • this the solution:

    https://www.youtube.com/watch?v=CUfci2AEBNk&t=3s

    type this/copy&paste: %userprofile%.platformio\packages,

    you'ill find framework-arduino-avr folder

    and then you deleting the framework-arduino-avr folder