因为本次项目使用的主要是C语言,所以使用C语言代码,先创建项目

1、下载paho.mqtt.c库

git clone https://github.com/eclipse/paho.mqtt.c.git

mqtt学习-2  创建c vs项目

2、安装cmake-gui

cmakes是生成跨平台工程的工具,比如可以为工程生成.sln文件在Visual Studio上打开,也可以生成.pro文件在QtCreator上打开。

打开网址:https://cmake.org/download/  

mqtt学习-2  创建c vs项目

 

 实际下载地址:

https://github.com/Kitware/CMake/releases/download/v3.19.6/cmake-3.19.6-win64-x64.msi

3、安装

mqtt学习-2  创建c vs项目

mqtt学习-2  创建c vs项目

 

 运行,设置Source,Build,Configure,点Generate

mqtt学习-2  创建c vs项目

 

 

mqtt学习-2  创建c vs项目

 这样创建的项目编译时会有两个问题,后面会提到,需要使用下面这个配置,因为上面选择了64位,注意需要下载64位的OpenSSL

mqtt学习-2  创建c vs项目

 

 

 4、生成文件如下

mqtt学习-2  创建c vs项目

 

相关文章:

  • 2021-04-02
  • 2022-12-23
  • 2020-06-22
  • 2021-08-12
  • 2021-04-16
  • 2021-10-31
  • 2021-09-02
  • 2021-05-04
猜你喜欢
  • 2022-01-02
  • 2021-08-01
  • 2021-07-06
  • 2022-01-13
  • 2022-12-23
  • 2021-06-03
  • 2021-09-22
相关资源
相似解决方案