Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately

ParamousGIS發表於2024-03-22


VSCode + MSBuild 開發過程中出現如下警告:


Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately


處理方法為,在 c_cpp_properties.json 檔案中加入 "_WIN32_WINNT>=0x0A00" 的定義,配置如下:


{
  "configurations": [
    {
      "name": "Win32",
      "includePath": [        
        "${workspaceFolder}/**"
      ],
      "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE",
        "_WIN32_WINNT>=0x0A00"
      ],
      "windowsSdkVersion": "10.0.22000.0",
      "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe",      
      "cStandard": "c17",
      "cppStandard": "c++17",
      "intelliSenseMode": "windows-msvc-x64",
      "configurationProvider": "ms-vscode.cmake-tools"
    }
  ],
  "version": 4
}

相關文章