I found the problem! I can now, with a minor change, compile it without any casting. Ready to know what the issue was?
*drum roll*
It was being compiled with g++ and not gcc.
*badum tish*
The makefile was using CXX set to gcc, so when I had it use the environment vars on the system, it...