Hi there,
Let the following code be a simple useless application:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include <iostream>
extern "C" {
#include "windows.h"
#include "./ddk/hidsdi.h"
#include "setupapi.h"
}
int main()
{
GUID hid_guid;
HidD_GetHidGuid(&hid_guid);
std::cerr << "Success" << std::endl;
}
|
To build this code I used gcc included in mingw. As a preface I had to download Windows DDK since hid.lib and setupapi.lib aren't included in mingw. The compiler actually uses headers from the mingw inc directory since the ones from the windows DDK are, afaik, intended to be used with MSVCPP.
The program gets compiled without any either error or warning, but it doesn't work.
The control never manages to reach the line that outputs on std::cerr since no message is being output while executing, furthermore the application crashes and windows pops the classic [Send error report, Do not Send] error window.
I'm pretty useless in windows programming, any suggestion or advice would be really appreciated.
EDIT: I tried to build the same program by compiling it with gcc instead of g++ ( obviously replacing the cpp streams with printf ) and it works just fine... I don't see the point :(