I also had an error 65. In my case it was because of simple syntax errors (missing semicolon, etc.) in code that was, because of preprocessor variables, not built when using Xcode to build a debug version, but was built when using xcodebuild to build a release version. After I built a release version in Xcode, saw and fixed the errors, the error 65 disappeared.
The key here was that xcodebuild wasn't building the same code as Xcode.