add error checking to the build, using code submitted for
merging into openxt.git
Merge pull request #2 from dickon/master

add error checking to the build