我无法摆脱这些简单的错误,但是如果有人能够从这些错误中解脱出来,那么它就会非常充实.我包括了windows.h和一些其他必要的标题,但无法摆脱它.
错误片段:
error C2146: syntax error : missing ';' before identifier 'MMVERSION' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2143: syntax error : missing ';' before '*' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2146: syntax error : missing ';' before identifier 'ms' error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
提前致谢
为了扩大在安东的回答是:WINDOWS.H #define
š UINT
是unsigned int
.这是一个C宏定义,而不是typedef
.如果你#include windows.h
在#include mmsystem.h
他之前他指出的那一行将被解读为:
typedef unsigned int MMVERSION;
但是,如果你以错误的方式执行它,那么UINT将扩展为空,并且该行将变为:
typedef MMVERSION;
这不是有效的C++,你会得到一个解析错误.这正是你得到的.