C++ 微软VSCode C/C++;IntelliSense显示有关Windows.h宏的错误
这个程序编译得很好。显示错误的是microsoft C/CPP Intellisense。错误已在下面注释掉。我怀疑这些错误的来源是Windows.h文件,因为它不允许我使用WINAPI关键字C++ 微软VSCode C/C++;IntelliSense显示有关Windows.h宏的错误,c++,visual-studio-code,visual-c++,intellisense,C++,Visual Studio Code,Visual C++,Intellisense,这个程序编译得很好。显示错误的是microsoft C/CPP Intellisense。错误已在下面注释掉。我怀疑这些错误的来源是Windows.h文件,因为它不允许我使用WINAPI关键字 #include <stdint.h> #include <math.h> #define local_persist static #define global_variable static #define internal static #define pi32 3.14
#include <stdint.h>
#include <math.h>
#define local_persist static
#define global_variable static
#define internal static
#define pi32 3.14159265359f
typedef uint32_t uint32;
typedef int32_t int32;
typedef uint32 bool32;
#include <Windows.h>
// typedef int __stdcall test(int x, int y)
// expected a ';'C/C++(65)
typedef int WINAPI test(int x, int y);
// int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
// expected a ';'C/C++(65)
int WINAPI wWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
PWSTR pCmdLine, int nCmdShow){
int num;
num = 5;
while(true){
// nothing here
}
return 0;
}
#包括
#包括
#定义本地持久静态
#定义全局变量静态
#定义内部静态
#定义pi32 3.14159265359f
类型定义uint32\u t uint32;
typedef int32_t int32;
类型def uint32 bool32;
#包括
//typedef int_ustdcall测试(int x,int y)
//应为“;”C/C++(65)
typedef int WINAPI测试(int x,int y);
//国际标准普尔wWinMain(国际标准普尔、国际标准普尔、国际标准普尔、国际标准普尔、国际标准普尔)
//应为“;”C/C++(65)
int WINAPI wWinMain(HINSTANCE HINSTANCE,
HINSTANCE HPPrevenstance,
PWSTR pCmdLine,int nCmdShow){
int-num;
num=5;
while(true){
//这里什么都没有
}
返回0;
}
有什么线索可能触发智能感知错误吗?如有必要,要求澄清。您在这些陈述中遗漏了分号。错误还说,@KrishnaKanthYenumula我没有漏掉分号。正如我所说,代码编译并给出所需的输出。当我使用
\uu stdcall
时,尽管这是WINAPI
的定义,但一切都很好。为什么intellisense不能读取正确的宏?