The PS2X library suddenly refuses to compile

For reference, the PS2X library can be found here:

I’ve been working with this library for about a day or two, and so far it’s been doing me well. However, just a couple hours ago, every program that I include its header in refuses to compile, including the example. I don’t recall making any significant changes to it.

Below is an incredibly simple program I wrote that uses absolutely nothing from the library. Without the include statement at the top, it compiles. With the include statement, it explodes with the errors listed in the next post (it was too long to fit in this post).

#include <PS2X_lib.h>

void setup()
  pinMode(13, OUTPUT);

void loop()
  digitalWrite(13, HIGH);

I’ve tried including the SPI library, as well, and it doesn’t give me any trouble. It looks, judging from the error locations, as if the problem is with the built-in AVR hardware libraries, but I don’t know a) why that would cause problems with print and println, nor b) why that should start happening now – I haven’t touched anything past the header file for the PS2X library, where I only made minor spacing changes (and if I remember correctly, I only made them in a copy outside the libraries folder I had for actually figuring out what this guy did).

I looked for other people with the print/println problem at the end of the explosion, and it was suggested that all #include “WProgram.h” statements should be replaced with #include “Arduino.h” for IDEs version 1.0+ (mine is 1.0.3), so I tried that and I still get the same errors. I haven’t yet uninstalled/reinstalled the Arduino IDE and the PS2X library, but I’d rather that be a last resort if there’s really nothing else I can do.

Does anyone have any idea what I could try next? I’ve only recently gotten into Arduino, so I don’t have the most extensive knowledge in the area.

Erm, hold on, the error message is so long I can't put it in this message. I'll put a link to a pastebin with the errors.


Here is a link to the error logs:

Putting the errors in this format has actually made it incredibly clear that the problem is with an apparently botched typedef that defines "size_t". Huh. I'm going to try locating and fixing this problem to see what it does, and I'll get back soon.

I downloaded the library, and pasted your code into the IDE. The error message I got was very short:

Binary sketch size: 4,284 bytes (of a 258,048 byte maximum)

That's not an error message. :P However, that is what I was getting before. Maybe I do need to reinstall. I'm going to restart my computer again and see what that does.


sigh I am so sorry for wasting your time. It turned out reinstalling the library fixed everything. :blush: Lesson learned: if a library causes you trouble, reinstall the library. It's not that hard.