edgexfoundry device-sdk-c编译过程记录

发布于:2023-09-15 ⋅ 阅读:(116) ⋅ 点赞:(0)

centos7环境

1、首先升级gcc从4.8.5到高版本

centos 升级gcc - tycoon3 - 博客园 (cnblogs.com)

使用scl enable devtoolset-x bash不生效时,使用source /opt/rh/devtoolset-x/enable就生效了。

目前只能下载到devtoolset-7  devtoolset-8等高版本的了,7以下无可用安装包。

2、依赖不少,挨个安装,github下载或搜安装方法,注意版本要求,后附整合的完整全量安装包

  • curl (version 7.32 or later)
  • microhttpd (version 0.9)
  • libyaml (version 0.1.6 or later)
  • libcbor (version 0.5)
  • paho (version 1.3.x) 这个指的就是libpaho-mqtt
  • libuuid (from util-linux v2.x)
  • hiredis (version 0.14)

3、cmake -DCMAKE_BUILD_TYPE=Release  -DBUILD_SHARED_LIBS=ON ./ 编译libcbor动态库

4、编译例子代码 gcc -I$CSDK_DIR/include -L$CSDK_DIR/lib  -o device-example-c template.c -lcsdk -lcurl 

5、例子启动时报错Failed to start HTTP server  ,见https://github.com/orgs/edgexfoundry/discussions/65

应该是获取的ip端口 不行,导致启动不了http server,检查网络端口吧,尤其是在虚拟机里跑的同志,vpn关掉  wifi关掉 就可以了

qq群号923594988交流


网站公告

今日签到

点亮在社区的每一天
去签到