added #include <cstdlib> to define ulong and uchar. If they are