Tips and Tricks (9)

Previous T&T

This trick relates to the use of nested Libraries, e.g. LibB Library requires functions from LibA Library. Ultimately, LibB functions are to be used in MyApp application

This the way of building header and code files:

LibA.h

#ifndef LibA_h
#define LibA_h

#include 

class LibA {
public:
/* LibA functions */

private:

};

#endif

LibA.cpp

#include 
#include 

/* LibA functions */

LibB.h

#ifndef libB_h
#define libB_h

#include 
#include 

class LibB {
public:
	/* LibB functions */

private:

};

#endif

LibB.cpp

#include 

LibA LibAObject; 

/* LibB functions */

MyApp.pde

/* Both next lines are mandatory */
#include 
#include 

LibB LibBObject;

/* Application code */

Next T&T

One Comment

Leave a Reply

You must be logged in to post a comment.