简体   繁体   English

cpp/c++ 编译错误:combaseapi.h - 没有那个文件或目录

[英]cpp/c++ compilation error: combaseapi.h - No such file or directory

i have been working on a project that creates thread using CoInitializeEx function in cpp/c++.我一直在研究一个在 cpp/c++ 中使用 CoInitializeEx function 创建线程的项目。 When i try to compile the code, i get the following error;当我尝试编译代码时,出现以下错误; "fatal error: combaseapi.h: No such file or directory\n compilation terminated." “致命错误:combaseapi.h:没有这样的文件或目录\n 编译终止。”

I am on windows 10 and using VS code as IDE.我在 windows 10 上,使用 VS 代码作为 IDE。

Any help would be appreciated, Thank you!任何帮助将不胜感激,谢谢!

This is what i tried:这是我试过的:

  1. googling for a while but couldn't find the solution.谷歌搜索了一段时间,但找不到解决方案。

I do have compaseapi header file under the following path C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um我在以下路径 C 下有 compaseapi header 文件:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um

  1. Tried re-installing windows SDK尝试重新安装 windows SDK

If you have this file on your file system, but you get this kind of error, then your project is misconfigured.如果你的文件系统上有这个文件,但是你得到了这种错误,那么你的项目配置错误。 Adding the path you are mentioning to your include paths should help.将您提到的路径添加到包含路径应该有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM