I've found an even more simple way to fix tempnam.c to work on linux. Simple take out the #include <stdio.h> in tempnam.c as it is not needed anyway.