Hi all,
I'm working to my project with Arduino DUE but I'm now stopped by this error! I'm using Arduino IDE 1.5.4.
This the includes on my sketch:
#include <SD.h>
#include <SPI.h>
#include <TFT.h>
#include "TB6612FNG.h"
#include "QRE1113AEncoders.h"
#include "GeduinoPINS.h"
#include "Control.h"
This is the Control.h file:
#ifndef Control_h
#define Control_h
#include <SD.h>
#include <SPI.h>
#include <TFT.h>
class Control{
private:
public:
// Constructor
Control();
// Show splash screen for given time in milliseconds
void showSplashScreen(unsigned const long splashDelay);
};
#endif
The problem I have is related to usage of SD, SPI and TFT library. I need to use them on the Control class but if I remove the include for those libraries from my sketch I had a "No such file or directory" error.
In file included from Control.cpp:3:
Control.h:4: fatal error: SD.h: No such file or directory
compilation terminated.
Including those libraries on the sketch seems to fix this problem bit create a new one:
GeduIno.cpp.o: In function `PImage::read32(File)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:296: multiple definition of `PImage::read32(File)'
Control.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:296: first defined here
GeduIno.cpp.o: In function `PImage::read16(File)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:289: multiple definition of `PImage::read16(File)'
Control.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:289: first defined here
GeduIno.cpp.o: In function `PImage::loadImage(char const*)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:306: multiple definition of `PImage::loadImage(char const*)'
Control.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:306: first defined here
GeduIno.cpp.o: In function `Adafruit_GFX::image(PImage&, unsigned short, unsigned short)':
/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:231: multiple definition of `Adafruit_GFX::image(PImage&, unsigned short, unsigned short)'
Control.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/TFT/src/utility/Adafruit_GFX.h:231: first defined here
collect2: ld returned 1 exit status
Probably this is related to some problem with ifdef/endif on those libs but by now I still no found a solution...
PLEASE HELP ME!!!
Thanks
Ale