I had the same problem. What you need to do is add #include <stdlib.h> = at the top and it should work fine
View entire thread