Looks like the sketch isn't being linked against the Arduino core for some reason. Check the Arduino preferences.txt file and make sure "build.target" is set to "arduino" and that "build.extension" is "c". Take a look in /lib/targets/arduino and make sure that wiring.c and wiring.h are there.