gpt4 book ai didi

c++ - 代码分析说 Inconsistent annotation for 'wWinMain' : this instance has no annotations

转载 作者:IT老高 更新时间:2023-10-28 22:24:44 34 4
gpt4 key购买 nike

我正在写一些简单的 win32 东西,我正在使用以下 wWinMain

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PWSTR pCmdLine, int nCmdShow)

VS2012 express 代码分析说

C28251 Inconsistent annotation for function: this instance has an error Inconsistent annotation for 'wWinMain': this instance has no annotations. See c:\program files (x86)\windows kits\8.0\include\um\winbase.h(2201). LeesSpaceShip main.cpp 6

我什至不清楚注释是什么。那么什么是注解,我的代码中哪一部分出错了?

除了这个诊断,代码编译和运行都很好。

最佳答案

wWinMain在winbase.h中的声明(错误中提到)为:

wWinMain(
_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nShowCmd
);

您在 main.cpp 中的 wWinMain 实现缺少 SAL annotations并且代码分析会警告您不匹配。

关于c++ - 代码分析说 Inconsistent annotation for 'wWinMain' : this instance has no annotations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13078953/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com