【发布时间】:2012-05-25 23:36:15
【问题描述】:
我拿了this code 作为编写服务的示例。我对我的主要功能进行了一些更改,以便使用命令行参数并删除
#define UNICODE
#define WINVER 0x502
我正在使用“MINGW”。
我收到以下错误:
usb_detect.c: In function 'ServiceMain':
usb_detect.c:123:16: error: unknown type name 'DEV_BROADCAST_DEVICEINTERFACE'
usb_detect.c:132:41: error: request for member 'dbcc_size' in something not a structure or union
usb_detect.c:132:61: error: 'DEV_BROADCAST_DEVICEINTERFACE' undeclared (first use in this function)
usb_detect.c:132:61: note: each undeclared identifier is reported only once for each function it appears in
usb_detect.c:133:41: error: request for member 'dbcc_devicetype' in something not a structure or union
usb_detect.c:133:60: error: 'DBT_DEVTYP_DEVICEINTERFACE' undeclared (first use in this function)
usb_detect.c:136:117: error: 'DEVICE_NOTIFY_SERVICE_HANDLE' undeclared (first use in this function)
usb_detect.c:136:148: error: 'DEVICE_NOTIFY_ALL_INTERFACE_CLASSES' undeclared (first use in this function)
如果我取消注释 unicode 和 winver 没有错误,但命令行参数不起作用.. 我也包括了 dbt.h..
【问题讨论】:
标签: c winapi service windows-services mingw