Compile ex1 and fix errors

In the migration to CMake, the examples were no longer being
compiled.