Typedef警告和语法错误LPINPUT
Typedef warning and Syntax Error LPINPUT
我在编译一些使用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
这是一个严重而愚蠢的错误,导致了这个问题。对这一切感到抱歉。
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- 代码在main()中运行,但在函数中出现错误
- 释放错误后堆使用
- (C++)分析树以计算返回错误值的简单算术表达式
- Project Euler问题4的错误解决方案
- 我的字符计数代码计算错误.为什么
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 尝试导入pybind-opencv模块时出现libgtk错误
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 在某些循环内使用vector.push_back时出现分段错误
- MSVC多行宏编译器错误
- 静态数据成员的问题-修复链接错误会导致编译器错误
- 为什么在运行时没有向我们提供有关分段错误的更多信息?
- Typedef警告和语法错误LPINPUT