Generate compilable c++ code.
Add error messages.