OpenXcom Forum

Contributions => Builds & Ports => Topic started by: grrussel on May 04, 2015, 07:06:33 pm

Title: OSX build error
Post by: grrussel 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
Title: Re: OSX build error
Post by: winterheart on May 17, 2015, 09:21:05 pm
I believe that fixed in https://github.com/SupSuper/OpenXcom/commit/a15a62541acc12d87c51ca4a5cf372d2bb18be30