Cpp11

Added C++11 flag and removed all related errors and warnings.