PS2Keyboard library giving "Multiple definition of..." errors.

For my current (and extremely incomplete) project, I am attempting to use both the PS2Keyboard and TVOut libraries.
PS2Keyboard: Arduino Playground - PS2Keyboard
TVOut: Arduino Playground - TVout

Put simply, I checked around for a solution to my problem (i.e. every single function in the PS2Keyboard library being defined twice) and found this on StackOverflow:

...But cross-referencing the solution with my program and libraries lead me to believe that something else is at play. Here's the beginning of each file in my sketch folder:

MURICANKeyboardToTV

#include <PS2Keyboard.h>

const int DataPin = 8;
const int IRQpin = 3;

PS2Keyboard keyboard;

#include <TVout.h>
#include <fontALL.h>
#include "TVOlogo.h"


TVout TV;


//Nothing relevant beyond this point.



void setup() {

PS2Keyboard.cpp

 #include "PS2Keyboard.h"

#define BUFFER_SIZE 45
static volatile uint8_t buffer[BUFFER_SIZE];
static volatile uint8_t head, tail;
static uint8_t DataPin;
static uint8_t CharBuffer=0;
static uint8_t UTF8next=0;
static const PS2Keymap_t *keymap=NULL;

PS2Keyboard.h

#ifndef PS2Keyboard_h
#define PS2Keyboard_h

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h" // for attachInterrupt, FALLING
#else
#include "WProgram.h"
#endif

#include "utility/int_pins.h"

//And then tons of stuff is #define'd.

TVOlogo.cpp

 #include "TVOlogo.h"
PROGMEM const unsigned char TVOlogo[] = {
//Figgis fiddus!

TVOlogo.h

#include <avr/pgmspace.h>
#ifndef TVOLOGO_H
#define TVOLOGO_H

extern const unsigned char TVOlogo[];
#endif

//And that's the end of the file. No, really.

Everything seems to be in order, but then again it might just be the case that I need "fresh eyes" to look at it. Suggestions, ideas, etc?

Sidenote: I'm hoping to turn this into a notepad program, with a PS2 keyboard as input, a TV as output, and an SD card as the storage medium. So far, all three components work perfectly by themselves (or at least I've had complete success with the demo programs for each...).

"Multiple definition of..." what?

//Nothing relevant beyond this point.

If you are so sure, why do you still have a problem?

  1. Whoops! I meant that I get a "multiple defintion of..." error for every single function declared in the PS2Keyboard library.
  2. Here's the full code; I just thought it was irrelevant because the problem is having functions defined multiple times.
#include <PS2Keyboard.h>

const int DataPin = 8;
const int IRQpin = 3;

PS2Keyboard keyboard;

#include <TVout.h>
#include <fontALL.h>
#include "TVOlogo.h"


TVout TV;






void setup() {
  keyboard.begin(DataPin, IRQpin, PS2Keymap_US);  
  Serial.begin(9600);
  Serial.println("'MURICAN Keyboard Test:");


  TV.begin(NTSC,120,96);
  TV.select_font(font6x8);
  intro();
  TV.println("Printing keyboard input..");
  TV.delay(2000);
  TV.clear_screen();
  TV.select_font(font6x8);
}

void loop() {
  
    if (keyboard.available()) {
      char c = keyboard.read();
      Serial.print(c);
      TV.println(c);
  }
    else {
      Serial.print("What? Where's the keyboard?");
      delay(2500);
      Serial.print("I'll give you a second to try that again.");
      delay(10000);
    }
}

void intro() {
unsigned char w,l,wb;
  int index;
  w = pgm_read_byte(TVOlogo);
  l = pgm_read_byte(TVOlogo+1);
  if (w&7)
    wb = w/8 + 1;
  else
    wb = w/8;
  index = wb*(l-1) + 2;
  for ( unsigned char i = 1; i < l; i++ ) {
    TV.bitmap((TV.hres() - w)/2,0,TVOlogo,index,w,i);
    index-= wb;
    TV.delay(50);
  }
  for (unsigned char i = 0; i < (TV.vres() - l)/2; i++) {
    TV.bitmap((TV.hres() - w)/2,i,TVOlogo);
    TV.delay(50);
  }
  TV.delay(3000);
  TV.clear_screen();
}

So, erm...what should I try now?

So, erm...what should I try now?

I tied downloading the libraries you are using. With your sketch, I got a bunch of compile errors. I gave up on making it work.

I'd guess that somehow, given the multiple declarations errors, that you have two copies of the PS2Keyboard library.

Apparently that was the problem; somehow I ended up with a copy of the PS2Keyboard library in the Arduino directory (instead of the libraries directory). Thanks!

EDIT: Oh great, now it's finding issue with a copy of the library in some Temp folder. sigh