From 2a8c06381fbc6fdb7e6363d0cb5d1c16019ccab0 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 12 Feb 2014 15:25:58 +0100 Subject: [PATCH] Added some friendly messages for Arduino Robot include errors on old sketches After merging #1859, old sketches that uses Robot_Control library must include Wire.h and SPI.h to work properly. --- app/src/processing/app/debug/Compiler.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/processing/app/debug/Compiler.java b/app/src/processing/app/debug/Compiler.java index 850f7992e..516bdb009 100644 --- a/app/src/processing/app/debug/Compiler.java +++ b/app/src/processing/app/debug/Compiler.java @@ -536,6 +536,18 @@ public class Compiler implements MessageConsumer { } } + if (s.contains("undefined reference to `SPIClass::begin()'") + && s.contains("libraries/Robot_Control")) { + String error = _("Please import the SPI library from the Sketch > Import Library menu."); + exception = new RunnerException(error); + } + + if (s.contains("undefined reference to `Wire'") + && s.contains("libraries/Robot_Control")) { + String error = _("Please import the Wire library from the Sketch > Import Library menu."); + exception = new RunnerException(error); + } + System.err.print(s); }