Ok I see the problem. The JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE is defined by
Microsoft here
msdn.microsoft.com/en-us/library/windows/desktop/ms684147
It is supposed to be defined in winnt.h. With MinGW-w64 this has been the case
for at least 3 years, as can be seen here
mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-headers/include/winnt.h?revision=1384&view=markup
However for some reason MinGW has failed to include this definition in their
version of the header. I would suggest compiling with MinGW-w64, which you can
get by itself or as part of a Cygwin installation. If you are adamant about
using MinGW I am willing to accept a patch, but I have no interest in developing
for a crippled platform (irony recognized).