当前位置:网站首页>Solve problems encountered when compiling mosquitto
Solve problems encountered when compiling mosquitto
2022-07-22 21:34:00 【panfei263031】
There are four problems :
- Can't find cJSON.h
- Can't find -lcjson
- make: xsltproc: Command not found
- I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
- problem 1: Can't find cJSON.h
Need to download cjson Source code , You can go to github download :
https://github.com/DaveGamble/cJSON
And then use git clone Download it .
But still in config.mk In the CFLAGS Add the download just now cjson The path of , such gcc Can we find . We'll talk about that later .
- problem 2: Can't find -lcjson
without libcjson.a perhaps libcjson.so, Then compile a , Compile command :
gcc -c -fPIC cJSON.c -o cjson.o
ar -cr libcjson.a cjson.o
If you want to compile so file , take ar The command is replaced by :
gcc -shared -o libcjson.so cjson.o
Then we should config.mk Medium CFLAGS and LDFLAGS add -I and -L, Appoint cJSON.h and libcjson.a The path of . The specific path depends on cjson Depends on the download path , For example, mine is :
CFLAGS+=-I/home/mokar/work/proj/pf/obu/cv2x_obu/mocar/lib/imx6/cJSON
LDFLAGS?=-L/home/mokar/work/proj/pf/obu/cv2x_obu/mocar/lib/imx6/cJSON
meanwhile , By the way config.mk add DESTDIR The path of , If you don't specify DESTDIR The path of , Default install to /usr/local below , If you don't want to install here , It's just config.mk In Chinese, it means DESTDIR Specify a path :
DESTDIR=/home/mokar/work/lib/mosquitto/mosquitto/target
- problem 3: Can't find xsltproc
- problem 4: Can't download docbook.xsl
Questions 3 and 4 , Execute the following command :
sudo apt-get install xsltproc docbook-xsl docbook-xml
Reference to the original link https://blog.csdn.net/weixin_30325793/article/details/99148948
边栏推荐
猜你喜欢
Buuctf entry diary -- [suctf 2019]checkin1()
YOLO9000: Better, Faster, Stronger
妙啊!美团 OCTO 分布式服务治理系统,这描述也太清晰了
[GXYCTF2019]BabyUpload1
1. Virtualization and container technology
acwing-费解的开关
MVCC
Significance learning record of FFT in MATLAB
Buuctf entry diary -- [nctf2019]fake XML Cookbook
C# Winform开发 打开txt文件 并显示在 RichTextBox中 加上编辑后保存功能
随机推荐
校园IP网络广播案例-石家庄法商中等专业学校鹿泉校区校园IP广播系统应用
Blue Bridge Cup - incremental triples
Wechat applet comprehensive case practice 1
8. Memory and disk management
蓝桥杯-连号区间数
New cover of time: metauniverse will change everything
中等专业学校校园广播系统解决方案-职业中专校园IP网络广播应用
About dichotomy
WinAppDriver 自动测试 winform 自动测试的部署
操场运动场室外扩声系统方案与功能分析
Recent research directions
Learning notes of wechat applet introduction tutorial - operation feedback of UI chapter
YOLO9000: Better, Faster, Stronger
JUC-8.0-Future和Callable
[lttng learning journey] - trace control -- advanced
Bash basic function - Historical command and completion
[lttng learning journey] - simply add a trace point to the user program
How to do research and development lean demand management well
Buuctf breakthrough diary 02-- [hctf 2018] warmup1
1.1.2计网——标准化工作机器相关组织,性能指标