The solution was in the mingw compiler, I started from scratch with MSYS and installed freeglut from there then it worked