add missing include
add compile flags" C++11; optimize, and warnings
fix some compiler warnings