OS -Windows 10 x64
库mqtt Microsoft Visual Studio Community 2017版本15.9.15
编程语言- C++17
使用vcpkg安装paho-mqtt paho-mqttpp3 3
我正在使用mqtt创建一个c++程序。但是每当我在给定的标题下面使用
#include <mqtt/async_client.h>
它给出了以下错误
d:\vcpkg\installed\x64-windows\include\mqtt\async_client.h(27): fatal error C1083: Cannot open include file: 'MQTTAsync.h': No such file or directory
但是MQTTAsync.h文件在给定的位置D:\vcpkg\installed\x64-windows\include\paho-mqtt
上可用
我按照下面的链接创建了新的控制台项目。
https://github.com/Microsoft/vcpkg/issues/1848
问题还没有得到解决
发布于 2022-05-02 08:59:04
验证vcpkg目录中的正确名称。
在我的例子中,那将是C:\Users\USERNAME\vcpkg\installed\x64-windows\include\paho-mqtt
在这里,您将看到您正在寻找的头文件实际上称为MQTTAsync.h。
要将其添加到您的项目中,您必须将inlcude更改为#include <paho-mqtt/MQTTAsync.h>
https://stackoverflow.com/questions/57668370
复制相似问题