g++ doesn't recognize random number function

I include ctime in my file. However, when I compile it via command line, it says that srand() and rand() aren't declared within the scope of the function I put them in. The weird thing is, my IDE compiles it perfectly, and it does so using g++. Can anybody help me out?
rand isn't defined in <ctime>. It is defined in <cstdlib>. Is that header included?
Topic archived. No new replies allowed.