'Can't use TerminateProcess with msys2 on Win7

I'm making in gtk3 app that behaves like a launcher. I'm developing in linux and windows7 with msys2 and msvc2010. Everyhing is fine except that I can't use TerminateProcess because I get this warning:

implicit declaration of function 'TerminateProcess'

This is part of the code:

#if defined(G_OS_WIN32)
#if defined(__GNUC__)
#include <w32api.h>
#define WINVER WindowsXP
#define _WIN32_WINNT WindowsXP
#define _WIN32_WINDOWS WindowsXP
#define _WIN32_IE IE7
#endif
#include <processthreadsapi.h>
#endif
#include <gtk/gtk.h>

// ...

void kill_process (GPid pid)
{
#if defined(G_OS_WIN32)
    TerminateProcess (pid, 0);
#else
    kill (pid, SIGTERM);
#endif
    g_spawn_close_pid (pid);
}

The above function kill_process works as expected in linux and in windows (msvc 2010), but it doesn't with msys2 mingw64... any ideas?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source