Author Topic: OSX build error  (Read 1924 times)

Offline grrussel

  • Captain
  • ***
  • Posts: 72
    • View Profile
OSX build error
« on: May 04, 2015, 07:06:33 pm »
c++ -Wall -Wextra -O2 -Wall -Wextra -DOSX -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/local/include/SDL -I/usr/local/Cellar/yaml-cpp/0.5.1/include  -c -o ../obj/RNG.o Engine/RNG.cpp
Engine/RNG.cpp:104:15: error: use of undeclared identifier 'rand'
        return (int)(rand() % (max - min + 1) + min);
                     ^
1 error generated.

I believe the stdlib.h header needs included, explicitly, in the .cpp file.

Cheers,
George

Offline winterheart

  • Colonel
  • ****
  • Posts: 180
  • Fellow Squaddie
    • View Profile
Re: OSX build error
« Reply #1 on: May 17, 2015, 09:21:05 pm »