微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Microsoft VSCode C/C++ IntelliSense 显示有关 Windows.h MACROS 的错误错误

如何解决Microsoft VSCode C/C++ IntelliSense 显示有关 Windows.h MACROS 的错误错误

这个程序编译得很好。显示错误的是 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.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,int nCmdshow){

    int num;
    num = 5;

    while(true){
        // nothing here
    }

    return 0;
}

有什么线索可能会触发这种智能感知错误吗?如果需要,请要求澄清。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。