Author Topic: undefined reference to `Serial'  (Read 15316 times)

Offline maro

  • Single posting newcomer
  • *
  • Posts: 4
undefined reference to `Serial'
« on: December 14, 2018, 03:07:39 pm »
Hi,

I am trying to use the Code::Blocks IDE for my Arduino UNO development. I have the follwing code:

Code
#include <Arduino.h>

/*
  Turns on an LED on for one second, then off for one second, repeatedly.

  This example code is in the public domain.
*/

void setup()
{
Serial.begin(9600);

// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}

void loop()
{
Serial.println("Hello world!");

digitalWrite(13, HIGH);   // set the LED on
delay(1000);              // wait for a second
digitalWrite(13, LOW);    // set the LED off
delay(1000);              // wait for a second
}

So nothing special. In addition I am using the GCC AVR from the Arduino IDE. When I try to compile the project I get the following error:

Code


-------------- Build: Arduino Uno in Uno (compiler: GNU GCC Compiler for AVR)---------------

avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c cores\CDC.cpp -o .objs\cores\CDC.o
avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c cores\HardwareSerial.cpp -o .objs\cores\HardwareSerial.o
avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c cores\HID.cpp -o .objs\cores\HID.o
avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c cores\IPAddress.cpp -o .objs\cores\IPAddress.o
avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c cores\main.cpp -o .objs\cores\main.o

...

avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c cores\WMath.cpp -o .objs\cores\WMath.o
avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c cores\WString.cpp -o .objs\cores\WString.o
avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c libraries\libraries.cpp -o .objs\libraries\libraries.o
avr-g++.exe -DF_CPU=16000000L -DARDUINO=103 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -s -DUSE_EEPROM=0 -DUSE_ETHERNET=0 -DUSE_FIRMATA=0 -DUSE_LCD=0 -DUSE_LCD4884=0 -DUSE_OBD=0 -DUSE_SD=0 -DUSE_SERVO=0 -DUSE_SOFTSERIAL=0 -DUSE_SPI=0 -DUSE_STEPPER=0 -DUSE_TINYGPS=0 -DUSE_WIRE=0 -Wall -Os -mmcu=atmega328p -D__AVR_ATmega328P__ -I. -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\EEPROM" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Ethernet" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Firmata" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Flash" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4884" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LCD4Bit_mod" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\LiquidCrystal" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\OBD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SD\utility" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Servo" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SevenSegment" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SoftwareSerial" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\SPI" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Stepper" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\TinyGPS" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire" -I"C:\Program Files (x86)\CodeBlocks\arduino\libraries\Wire\utility" -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\cores\arduino -IH:\Programme\Arduino-1.8.8-windows\libraries -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\variants\standard -IH:\Programme\Arduino-1.8.8-windows\hardware\arduino\avr\libraries\HID\src -IH:\Programme\SysGCC\avr\avr\include -IH:\Programme\SysGCC\avr\include -c sketch.cpp -o .objs\sketch.o
avr-g++.exe -LH:\Programme\SysGCC\avr\lib -LH:\Programme\SysGCC\avr\avr\lib -o bin\Release\Uno.elf .objs\cores\CDC.o .objs\cores\HardwareSerial.o .objs\cores\HID.o .objs\cores\IPAddress.o .objs\cores\main.o .objs\cores\new.o .objs\cores\Print.o .objs\cores\Stream.o .objs\cores\Tone.o .objs\cores\USBCore.o .objs\cores\WInterrupts.o .objs\cores\wiring.o .objs\cores\wiring_analog.o .objs\cores\wiring_digital.o .objs\cores\wiring_pulse.o .objs\cores\wiring_shift.o .objs\cores\WMath.o .objs\cores\WString.o .objs\libraries\libraries.o .objs\sketch.o  -Wl,--gc-sections -s -mmcu=atmega328p 
.objs\sketch.o: In function `setup':
sketch.cpp:(.text.setup+0xa): undefined reference to `Serial'
sketch.cpp:(.text.setup+0xc): undefined reference to `Serial'
.objs\sketch.o: In function `loop':
sketch.cpp:(.text.loop+0x4): undefined reference to `Serial'
sketch.cpp:(.text.loop+0x6): undefined reference to `Serial'
.objs\cores\wiring.o: In function `delay':
wiring.c:(.text.delay+0x26): undefined reference to `yield'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
6 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 

So I thought Serial should be defined in "HardwareSerial" which seems to compile without errors.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: undefined reference to `Serial'
« Reply #1 on: December 14, 2018, 07:32:17 pm »
How have you generated the project? Are you using the integrated template?
What version of arduino are you using?

Have you tried my version: https://github.com/obfuscated/cb_arduino_template (it is not really tested on windows :()
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline maro

  • Single posting newcomer
  • *
  • Posts: 4
Re: undefined reference to `Serial'
« Reply #2 on: December 14, 2018, 09:13:19 pm »
Hmm I tried your suggestion. So I applied your template.

Now when I create a new project (Arduino) I get an error dialog "Arduino Project has failed to load XRC resource..." not sure what this means to be honest :-)

Nevertheless I can click OK and continue. When it comes to select a port I see  a lot of different linux devices starting with tty instead of COM for windows. But there it is possible to enter a free text. Now when I try to compile the project I get no error and I can upload the program to my Arduino - Great!!!!

Nevertheless I would like to understand what is really going wrong when i use the "previous old" template for the arduino. Any idea what's wrong there? And in addition how can i get rid of this XRC resource issue?

Thanks,
maro

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: undefined reference to `Serial'
« Reply #3 on: December 15, 2018, 12:16:26 am »
Most probably you have newer arduino and the old template supports only the 1.0.x versions. There were big changes around the 1.5.x releases of arduino.

What version of codeblocks are you using? The template requires something like 16.01 or 17.12.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline maro

  • Single posting newcomer
  • *
  • Posts: 4
Re: undefined reference to `Serial'
« Reply #4 on: December 15, 2018, 11:21:14 am »
I have 17.12 installed. So you think this is the reason for the XRC issue?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: undefined reference to `Serial'
« Reply #5 on: December 15, 2018, 12:39:43 pm »
17.12 should be fine. I don't know the reason for the error... It seems some xrc file is not found.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: undefined reference to `Serial'
« Reply #6 on: December 15, 2018, 04:44:02 pm »
Now when I create a new project (Arduino) I get an error dialog "Arduino Project has failed to load XRC resource..." not sure what this means to be honest :-)
This means that the wizard.xrc file in the arduino template has problems loading for some reason.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline maro

  • Single posting newcomer
  • *
  • Posts: 4
Re: undefined reference to `Serial'
« Reply #7 on: December 16, 2018, 07:51:40 am »
So I assumed this already  :D

Do you know a way to debug or get more detailed log while loading the xrc file. So perhaps I can fix this? I am not really familiar with the code blocks templates...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: undefined reference to `Serial'
« Reply #8 on: December 16, 2018, 08:17:34 am »
At the moment you have to use a debugger to debug cb itself.

I've pushed a fix which will show the full path to the xrc file. Hopefully this would make easier for people to debug using future versions of cb.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]