Fix exception handling to have no warning
Currently, the C++ exception handling catches exceptions by copy. This generates a lot of warnings from the compiler. The suggested way to catch exceptions is by reference. While on it, fix building (include required library) and fix URL in generated code