Why the codes don´t compile in Win 10 ?

Either move your sketchbook to a location outside of onedrive, or turn off Files on demand option (that's what breaks it).