ZBLOG

CMake Error at src/CMakeLists.txt:59 (add_library): Target "paho-mqttpp3" links to target "eclipse-paho-mqtt-c::paho-mqtt3as" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target ...

这个错误通常表示在 CMake 构建过程中找不到 eclipse-paho-mqtt-c::paho-mqtt3as 目标。出现此错误的原因可能是没有正确安装 eclipse-paho-mqtt-c 库,或者 CMake 无法找到它。

请确保已经按照正确的步骤安装了 eclipse-paho-mqtt-c 库,并且库所在的路径已添加到 CMake 的搜索路径中。

另外,请确认你是否在项目的 CMakeLists.txt 文件中使用了 find_package() 调用来查找和导入 eclipse-paho-mqtt-c 库。示例如下:

find_package(eclipse-paho-mqtt-c REQUIRED)

# ...

add_library(paho-mqttpp3 ...)
target_link_libraries(paho-mqttpp3 PRIVATE eclipse-paho-mqtt-c::paho-mqtt3as)

如果仍然遇到问题,请检查相关文档和指南以获得更详细的解决方案。


内容由零声教学AI助手提供,问题来源于学员提问

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://sdn.0voice.com/?id=3061

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?