So, since I'm noob in C++, I decided to try to build just a piece of this, something simple like Fractal.cpp:
$ g++ src/Main\ executable/Fractal.cpp -o fractal && ./fractal && eog fractal.ppm
/usr/bin/ld: /tmp/ccQOgr8t.o: in function `GetRand(int)':
Fractal.cpp:(.text+0x10): undefined reference to `mrand()'
collect2: error: ld returned 1 exit status
I could not find implementation of this mrand() nowhere, just definitions. Google asks if I ment rand(), so when I define it like
int mrand()
{
return rand();
}
I'm able to get some blocky resemblance of a fractal noise using GetFractalVal():

Now I wonder if my mrand() implementation matches one that is linked somehow in Visual Studio? If we change all mrand() calls to rand() would it still build for Windows? And could we add unittests to make sure behaviour does not change when porting? (Like, given this random seed, assert that this fractal is generated).
And why mrand() definitions do not come from some header file related to some DLL, but declared in every file that uses it? (That's really strange for me as a programmer that mostly uses languages where things that imported imported from where they are implemented).
So, since I'm noob in C++, I decided to try to build just a piece of this, something simple like
Fractal.cpp:I could not find implementation of this
mrand()nowhere, just definitions. Google asks if I mentrand(), so when I define it likeI'm able to get some blocky resemblance of a fractal noise using
GetFractalVal():Now I wonder if my
mrand()implementation matches one that is linked somehow in Visual Studio? If we change allmrand()calls torand()would it still build for Windows? And could we add unittests to make sure behaviour does not change when porting? (Like, given this random seed, assert that this fractal is generated).And why
mrand()definitions do not come from some header file related to some DLL, but declared in every file that uses it? (That's really strange for me as a programmer that mostly uses languages where things that imported imported from where they are implemented).