srand(time(NULL)); is not working. it says it is "undefined"

I cant get visual studio to run the magic 8 ball program it keep saying “time is undefined” please help