MinGW isn't fully supported at this time. We have an experimental build, which you can access from here: https://community.leapmotion.com/t/mingw-support-please/270 -- but this doesn't come with any promise of future support.
Another option is to use the WebSocket server, which provides the same tracking data as a JSON string.