错误:无法打开包含文件:"MQTTAsync.h":没有此类文件或目录
Error: Cannot open include file: 'MQTTAsync.h': No such file or directory
OS -Windows 10 x64
Library mqtt Microsoft Visual Studio Community 2017 版本 15.9.15
编程语言 - C++17
Installed paho-mqtt paho-mqttpp3paho-mqttpp3[ssl]using vcpkg
我正在使用 mqtt 创建一个 c++ 程序。 但是每当我在下面使用给定的标题时
#include <mqtt/async_client.h>
它给出以下错误
d:vcpkginstalledx64-windowsincludemqttasync_client.h(27): fatal error C1083: Cannot open include file: 'MQTTAsync.h': No such file or directory
但是MQTTAsync.h文件在给定的位置可用D:vcpkginstalledx64-windowsincludepaho-mqtt
我通过创建新的控制台项目点击了以下链接
https://github.com/Microsoft/vcpkg/issues/1848
仍然问题未得到解决
验证 vcpkg 目录中的名称是否正确。
就我而言,这将是C:UsersUSERNAMEvcpkginstalledx64-windowsincludepaho-mqtt
在这里,您将看到您要查找的头文件实际上称为MQTTAsync.h
要将其添加到您的项目中,您必须将
包含更改为#include <paho-mqtt/MQTTAsync.h>
相关文章:
- 读取大文件(>2GB)(文本文件包含以太网数据)并通过不同参数随机访问数据的最佳方法是什么?
- C++文件包含多行
- CMake 如何强制third_party库将项目文件包含在当前项目源目录中?
- 是否可以将要"ShellExecute"的文件包含在 dll 中?如果是这样,"ShellExecute"中的文件位置应该是什么?
- C++ 逐行从文件(包含空格)读取数据
- 在 C++ 中,.h 文件包含文件但不起作用
- 生成的资源文件包含奇怪的包含文件
- 可变参数类的文件包含问题
- 为什么文件命令声明可执行文件包含"debug_info"
- 可以将标头文件包含在多个源文件中,而无需重复保护
- 为什么将.HPP文件包含在.h文件中
- Qt C++:将所有库文件包含在项目文件夹中
- 有条件地将文件包含在C++标头中
- 将多个原型文件包含在一个项目中会导致protobuf_AssignDescriptorsOnce()已经有一个主体
- 有没有办法将文件包含在C++中的所有项目文件中
- 将外部.asm文件包含到C++代码中
- 什么是"pch.h",为什么需要将其作为第一个头文件包含在内?
- 该头文件包含DirectX 12中的ThrowIfFailed()
- QT C :函数的多个定义当Header文件包含在MainWindow.h中时
- QT创建者错误地处理标头文件包含来自Directory