solved : static cast error when compiling for OSX