platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
136 stars 104 forks source link

"collect2.exe: error: ld returned 1 exit status" #279

Open ItsGosho opened 3 years ago

ItsGosho commented 3 years ago

When the any of the serial methods from Arduino is used the error in the title prevents me from building. Because of that I can't use any of the Serial methods when debugging.

The following will pass:

#include <Arduino.h>
#include "avr8-stub.h"

void setup()
{
  debug_init();

}

void loop()
{
  int a = 5;
}

But any of the following will not:

#include <Arduino.h>
#include "avr8-stub.h"

void setup()
{
  debug_init();

Serial.begin(9600);
Serial.print("Because of that is the coolect2.exe: error: Id returned 1 exit status");
}

void loop()
{
  int a = 5;
}

or

#include <Arduino.h>
#include "avr8-stub.h"

void setup()
{
  debug_init();

Serial.begin(9600);
}

void loop()
{
  int a = 5;
  Serial.println("Because of that is the coolect2.exe: error: Id returned 1 exit status");

}