Build failed without any tips

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: Atmel AVR (4.0.0) > Arduino Nano ATmega168
HARDWARE: ATMEGA168 16MHz, 1KB RAM, 14KB Flash
DEBUG: Current (simavr) On-board (simavr)
PACKAGES:

  • framework-arduino-avr @ 5.1.0
  • toolchain-atmelavr @ 1.70300.191015 (7.3.0)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 5 compatible libraries
    Scanning dependencies…
    No dependencies
    Building in release mode
    Compiling .pio\build\nanoatmega168\src\main.cpp.o
    Archiving .pio\build\nanoatmega168\libFrameworkArduinoVariant.a
    Compiling .pio\build\nanoatmega168\FrameworkArduino\CDC.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\HardwareSerial.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\HardwareSerial0.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\HardwareSerial1.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\HardwareSerial2.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\HardwareSerial3.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\IPAddress.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\PluggableUSB.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\Print.cpp.o
    Compiling .pio\build\nanoatmega168\FrameworkArduino\Stream.cpp.o
    *** [.pio\build\nanoatmega168\src\main.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\libFrameworkArduinoVariant.a] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\CDC.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\HardwareSerial.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\HardwareSerial0.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\HardwareSerial1.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\HardwareSerial2.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\HardwareSerial3.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\IPAddress.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\PluggableUSB.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\Print.cpp.o] Error 1
    *** [.pio\build\nanoatmega168\FrameworkArduino\Stream.cpp.o] Error 1
  • Is any antivirus active that could interfere?
  • When you delete C:\Users\<user>\.platformio\packages\toolchain-atmelavr and rebuild the project, does it have the same error?
  • When you delete C:\Users\<user>\.platformio\packages\framework-arduino-avr and rebuild the project, does it have the same error?

Thanks for your reply!
But I tried what you spoke, still build failed
And I also tried resetting platform, and restart my PC, and so on…
Several months ago when I used platformIO , it can run correctly, but now it goes wrong…

Can you please do a clean reinstall of PlatformIO by doing:

  • Remove the PlatformIO VSCode extension
  • Close VSCode
  • Remove the folder C:\Users\<user>\.platformio entirely
  • Start VSCode
  • Install the PlatformIO VSCode extension again
  • Let it install and restart VSCode
  • open the original project again
  • remove the .vscode folder of the project
  • Use Ctrl+Shift+P → Rebuild Intellisense
  • retry building the project

【solved】
Thank you very much for your reply although your method did not solve the problem :joy:
According to the step-by-step investigation, the source of the problem is finally found as follows:

  • The system disables cmd, which means that cmd automatically closes the moment it runs.
  • Reason: It may be that Anaconda is installed
  • Solution: Run PowerShell as administrator
    • enter:
      `C:\Windows\System32\reg.exe DELETE “HKCU\Software\Microsoft\Command Processor” /v AutoRun /f
1 Like

Thank you for your enthusiastic reply, and I wish the community better and better! :muscle:

Interesting, I never would have thought of that. Great that you found it and shared the solution.