Including Libraries (the correct way) Locally

So I’m compiling locally (on windows) and I’m having some issues porting a library I’m working on.

Here’s what I have done:

  • Added both my libraries to the libraries path
  • Added both my ePaper library and a SD library to the makefile using:

INCLUDE_DIRS += $(LIB_CORE_LIBRARIES_PATH)Small_ePaper_Shield
INCLUDE_DIRS += $(LIB_CORE_LIBRARIES_PATH)SD

I couldn’t find another way to actually include the libraries. Surely there is a better way that doesn’t require editing the makefile?

  • Added my code to application.cpp. A snippet is below

Code:

#include "application.h"
#include "ePaper.h"
#include <SPI.h>
#include <SD.h>
#include "GT20L16_drive.h"

#define EPD_SIZE    EPD_2_7

int x; 
char tmpTemp[15];
ePaper EPAPER;
sd_epaper eSD;
GT20L16_drive GT20L16;

SYSTEM_MODE(MANUAL);

void setup()
{
    Serial.begin(9600);
    while(!Serial.available());
    Serial.println("Program Start");
    Serial.println("This is a test!");
    EPAPER.begin(EPD_SIZE);
    EPAPER.setDirection(DIRNORMAL); 
    eSD.begin(EPD_SIZE);                                   
    GT20L16.begin();
    Serial.println("Setup end");
}

I end up with several errors like the below:

```./obj/src/application.o: In function setup': E:\Spark\Spark\firmware\build/../src/application.cpp:68: undefined reference toePaper::begin(EPD_size)‘
E:\Spark\Spark\firmware\build/…/src/application.cpp:69: undefined reference to ePaper::setDirection(EPD_DIR)' E:\Spark\Spark\firmware\build/../src/application.cpp:70: undefined reference tosd_epaper::begin(EPD_size)’


Any idea what's going on? The functions mentioned in "undefined" reference are there. In fact, NetBeans will autocomplete for them! 

Help me, @BDub, you are (almost) my only hope! (perhaps @mdma?)

Thanks,
Harrison  

Note: I originally didn't have the following references:

    ePaper EPAPER;
    sd_epaper eSD;
    GT20L16_drive GT20L16;

because they weren't needed in the Arduino enviroment. Something to do with the follow line (and similar) in ePaper.h:

    extern ePaper EPAPER;

but that doesn't appear to work in the Spark build enviroment

Ok. I have narrowed this issue down to a problem of not correctly including the libraries. Anybody have any ideas?

Hi, I’ve only just seen this thread. Do you still need a hand?

Any update?