fixed another bug in compiling c++ examples