fix includes and compilation flags