2024-10-31 17:52:29 +08:00
|
|
|
################################### 安装编译环境 ########################################
|
|
|
|
# 更新环境
|
|
|
|
sudo apt-get update
|
|
|
|
|
|
|
|
# 安装编译所需环境
|
2024-11-05 17:17:30 +08:00
|
|
|
sudo apt-get install g++ gcc gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
2024-10-31 17:52:29 +08:00
|
|
|
|
|
|
|
# 安装cmake和make
|
|
|
|
sudo apt-get install cmake make
|
|
|
|
|
|
|
|
# 安装git
|
|
|
|
sudo apt-get install git
|
|
|
|
|
|
|
|
################################### 安装代码依赖 ########################################
|
|
|
|
|
|
|
|
# 安装sqlite3库文件
|
|
|
|
sudo apt-get install libsqlite3-dev
|
|
|
|
|
|
|
|
# 安装xml库文件
|
|
|
|
sudo apt-get install libxml2-dev
|
|
|
|
|
|
|
|
# 安装ssl加密库
|
|
|
|
sudo apt-get install libssl-dev
|
|
|
|
|
|
|
|
# 安装cjson
|
|
|
|
sudo apt install libcjson-dev
|
|
|
|
|
|
|
|
# 安装paho.mqtt
|
|
|
|
git clone -b v1.3.13 https://github.com/eclipse/paho.mqtt.c.git
|
|
|
|
cd paho.mqtt.c
|
|
|
|
sudo mkdir build && cd build
|
|
|
|
sudo cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_SAMPLES=TRUE ..
|
|
|
|
sudo cmake --build . --target install
|
|
|
|
sudo make
|
|
|
|
sudo make install
|