Making a library

I have made two libraries an Engine and a UI.

From the sketch I want to access these. The problem is that the UI uses the UTouch and UTFT library and the engine use the DHT11 and RTCLib libraries amongst others. How can I link those libraries from my own? I have even done this:

#include "../UTFT/UTFT.h"
#include "../UTouch/UTouch.h"

Thanks.

How can I link those libraries from my own?

Just include the header file, like you would in a sketch. You also have to include the header file in the sketch.

I have even done this:

And?

I can link to my own library fine, how can I link to a library within a library?

#include "../UTFT/UTFT.h"
#include "../UTouch/UTouch.h"

And it does not work. So in my library I link to those, but those are not found.

#include "UTFT.h"
#include "UTouch.h"

Just like you would in a sketch.

So in my library I link to those, but those are not found.

Then it's time to post some code.

If I put this in my sketch, it compiles, Without those it says undefined reference.

#include <UTFT.h> // Graphics Library
#include <UTouch.h> //Touch Screen Library

but when it compiles it does not work.

so in the .cpp

// for the Arduino Mega 2560 pins and Sainsmart TFT shield.
UTFT myGLCD(ITDB32S, 38,39,40,41);
UTouch myTouch(6,5,4,3,2);

UI::UI() {

//Serial.begin(115200);
// Initial setup
myGLCD.InitLCD(); //CRASH HERE
myGLCD.clrScr();

myTouch.InitTouch();
myTouch.setPrecision(PREC_MEDIUM);

myGLCD.setFont(BigFont);
myGLCD.setBackColor(0, 0, 255);

}

in the .h file

// Declare which fonts we will be using
extern uint8_t BigFont[];

#include "../UTFT/UTFT.h"
#include "../UTouch/UTouch.h"

By sketch, I mean the .pde and not my library.

Typically, constructors should do nothing. You should have an init() or begin() method that does the work that a constructor would normally do. Why, you ask? Simple34, really. When is your constructor called? When is init() called to set up the hardware? If you don't KNOW, don't set up hardware in the constructor.

I agree with PaulS. Don't do that stuff in the constructor. It won't work, or won't work properly. Make a "begin" method and call that in setup.