Finally! I managed to kludge my way to a blinking LED
I had problems with M_PI in most of the module source files, and M_TWOPI (which was not referenced anywhere in my math.h, so I actually had to go to wolfram alpha to calulate it to 20 decimals ).
In a few source files, like mode.cpp, you even do this:
#ifndef M_PI
#define M_PI 3.14159265358979323846f /* pi */
#endif
If only that had been done in all of them, there would have been no problems. As to the other issues I had, maybe -Werror in the makefiles is a bad idea if you expect warnings The missing rand(), dunno, maybe it is defined in math.h on most other systems?
Anyways, it works now. I hope it may be a useful read to someone, probably on linux, like me