Arduino Due watchDog IDE 1.6.5-r5 Not Working

Hi, I've been trying to get the watchDog working for the Due and hoping someone can help.

It will work if I use IDE 1.6.6 however that version doesn't work with my libraries. I've been reading that it should work with 1.6.5 but can't get it to. In the boards manager I've tried all the different SAM cores from 1.6.2 - 1.6.11 with different errors. Some I could fix but can't figure this out. If I use IDE 1.6.5 with SAM core 1.6.5 or 1.6.6 I get the following error.

watchDog.cpp.o: In function loop': C:\Program Files (x86)\Arduino/watchDog.ino:25: undefined reference towatchdogReset()' watchDog.cpp.o: In function setup': C:\Program Files (x86)\Arduino/watchDog.ino:17: undefined reference towatchdogEnable(unsigned long)' collect2.exe: error: ld returned 1 exit status Error compiling.

This is the sketch I'm using. This sketch works with IDE 1.6.6 and SAM core 1.6.5 and 1.6.6.

int counter = 0;

// Defines the time for the watchdog in ms
int watchdogTime = 1000;

// this function has to be present, otherwise watchdog won't work
void watchdogSetup(void) 
{
// do what you want here
}

void setup() 
{
  // Enable watchdog.
  watchdogEnable(watchdogTime);
  Serial.begin(9600);
}

void loop() 
{
  // Reset watchdog
  watchdogReset();
  Serial.println(counter);
  delay(500);
  if(counter >= 10)
  { 
    while(true)
    {
      Serial.println("loop");
      delay(100);
    }
  }
  counter++;
}

If I browse to the directory C:\Users*\AppData\Roaming\Arduino15\packages\arduino\hardware\sam\1.6.5\cores\arduino I do see the watchdog.h and cpp file and the function names in the sketch match what's in these files.

Got it working. :)

Added this above the sketch I posted.

#include "watchdog.h"