SMlib stopped working with IDE upgrade

Hello,

I'm about a week out from a project deadline. My project relies heavily on the SMlib

http://playground.arduino.cc/Code/SMlib

I've used this library extensively and it's worked like a charm every time. I do a lot of simple robotics so it's a perfect fit. The problem is, last night I began working on a Teensy for part of the project. It has worked with the SMlib before, for a huge project that ran great. I installed the latest update to the IDE, then I installed the latest Teensy addon, and now NO project using the SMlib will compile! The IDE says that the states are not declared when they clearly are. The very simple example code won't even compile. Here's an example:

#include <SM.h>


SM Simple(S1);//create simple statemachine

#define toggle 9//pin to toggle led on and off
#define led 13

void setup(){
  pinMode(led, OUTPUT);
}

void loop(){
  EXEC(Simple);//run statemachine
}

State S1(){
  digitalWrite(led, HIGH);//turn led on
  if(digitalRead(toggle)) Simple.Set(S2);//wait for toggle pin to go high and change state to S2
}

State S2(){
  if(!digitalRead(toggle)) Simple.Set(S3);//wait for toggle pin to go low and change state to S3
}

State S3(){
  digitalWrite(led, LOW);//turn led off
  if(digitalRead(toggle)) Simple.Set(S4);//wait for toggle pin to go high and change state to S4
}

State S4(){
  if(!digitalRead(toggle)) Simple.Set(S1);//wait for toggle pin to go low and change state to S1
}

and it kicks out this error message:

Arduino: 1.6.6 (Mac OS X), TD: 1.26, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimized (overclock), US English"

example_2:4: error: 'S1' was not declared in this scope
SM Simple(S1);//create simple statemachine
^
exit status 1
'S1' was not declared in this scope

Anybody have any ideas? I'm supposed to start implementing today but now I'm stuck.

Here's a vid of a project I had where all these things worked before:

Just deleted IDE 1.6.6, went back to 1.0.6, it works. Problem solved I guess, just wish I could use the most up to date stuff.

Anybody have any ideas?

I have a idea that you need to post a link to the library.

When you init your state machine you just need to set the first state as a "pass-through"

So instead of

SM Simple(S1);//create simple statemachine

Just enter:

SM Simple(&S1);//create simple statemachine

Ampersand (&) before the state function name is the key..

For the purists - here is the link to the original library (without this explanation though):

http://playground.arduino.cc/Code/SMlib

You can have several copies of the IDE on the same PC. The IDE is just a Java program.

...R