Typedef警告和语法错误LPINPUT

Typedef warning and Syntax Error LPINPUT

本文关键字:错误 LPINPUT 语法 警告 Typedef      更新时间:2023-10-16

我在编译一些使用Direct Input 8的代码时遇到问题。我的代码中的其他一切都很好,但当输入代码被编译时,会弹出一系列警告和错误。

    1>  Input.cpp
    1>c:program files (x86)windows kits8.0includeumwinuser.h(5826): warning C4091:     'typedef ' : ignored on left of 'tagINPUT' when no variable is declared
    1>c:program files (x86)windows kits8.0includeumwinuser.h(5826): error C2143: syntax error : missing ';' before ','
    1>c:program files (x86)windows kits8.0includeumwinuser.h(5826): error C2059: syntax error : ','
    1>c:program files (x86)windows kits8.0includeumwinuser.h(5833): error C2061: syntax error : identifier 'LPINPUT'

这是在Visual Studio 2012中。关于是什么原因导致了这种情况,有什么想法吗?我检查了代码的其余部分是否缺少分号和逗号,但什么也找不到。你们以前有没有遇到过类似的问题?

以下是winuser.h 中的周围线条

#define INPUT_MOUSE     0
#define INPUT_KEYBOARD  1
#define INPUT_HARDWARE  2
typedef struct tagINPUT {
    DWORD   type;
    union
    {
        MOUSEINPUT      mi;
        KEYBDINPUT      ki;
        HARDWAREINPUT   hi;
    };
line 5826 } INPUT, *PINPUT, FAR* LPINPUT;

电流包含在输入中。H为

#include<dinput.h>
#include"MemUtils.h"

Input.cpp仅包括Input.H

我在input.h文件中使用了一些宏。

#ifndef INPUT
#define INPUT

这是一个严重而愚蠢的错误,导致了这个问题。对这一切感到抱歉。