You will need to install the old Xcode, remove MacOSX10.6.sdk from the SDK folder in the place where it was installed (default: /Developer/Platforms/MacOSX.platform/Developer/SDKs ), and copy it to the SDK folder in the last Xcode.app (default: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ).
As for fixing the error, try importing / including <sys/ucontext.h> instead of Apple ucontext.h .
source share