君正交叉编译链工具mips-gcc540-glibc222-64bit-r3.3.0.smaller.bz2编译st-device-sdk-c

bash 复制代码
git clone https://github.com/SmartThingsCommunity/st-device-sdk-c.git

cd st-device-sdk-c

git submodule update --init --recursive

#下载补丁包,下载地址https://github.ecodesamsung.com/SolutionsEngineering/TechSupport_Shawyar/blob/main/patch


#把下载的三个补丁文件放到st-device-sdk-c目录下,然后执行下面的三条语句

patch -p1 < 0001-PATCH-Requirement-change-to-apply-for-AV-SDK.patch
patch -p1 < 0002-Get-libiotcore.so-as-the-build-output.patch
patch -p1 < 0003-PATCH-cameraSDK-based-on-Raspberry.patch

#cd st-device-sdk-c

#执行 cmake -B build

-- The C compiler identification is GNU 5.4.0

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working C compiler: /opt/mips-gcc540-glibc222-64bit-r3.3.0.smaller/bin/mips-linux-gnu-gcc - skipped //此处会显示所用的编译器

-- Detecting C compile features

-- Detecting C compile features - done

include default stdk_config

Enter component.cmake

-- Looking for deps/json/cJSON/cJSON.h

如果遇到错误:cmake的版本过低,使用以下命令:

cmake -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.5

#cd build

#make
遇到这样的错误:[ 78%] Building C object src/CMakeFiles/iotcore.dir/iot_api.c.o

78%\] Building C object src/CMakeFiles/iotcore.dir/iot_capability.c.o \[ 79%\] Building C object src/CMakeFiles/iotcore.dir/iot_wt.c.o \[ 79%\] Building C object src/CMakeFiles/iotcore.dir/iot_main.c.o \[ 79%\] Building C object src/CMakeFiles/iotcore.dir/iot_nv_data.c.o \[ 80%\] Building C object src/CMakeFiles/iotcore.dir/iot_util.c.o \[ 80%\] Building C object src/CMakeFiles/iotcore.dir/iot_uuid.c.o \[ 81%\] Building C object src/CMakeFiles/iotcore.dir/iot_root_ca.c.o \[ 81%\] Building C object src/CMakeFiles/iotcore.dir/iot_log_file.c.o \[ 81%\] Building C object src/CMakeFiles/iotcore.dir/iot_dump_log.c.o \[ 82%\] Building C object src/CMakeFiles/iotcore.dir/port/bsp/raspberry/bluez/advertisement.c.o In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9:0, from /usr/include/glib-2.0/glib/gtypes.h:32, from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from /usr/include/glib-2.0/gobject/gbinding.h:28, from /usr/include/glib-2.0/glib-object.h:22, from /usr/include/glib-2.0/gio/gioenums.h:28, from /usr/include/glib-2.0/gio/giotypes.h:28, from /usr/include/glib-2.0/gio/gio.h:26, from /opt/test/st-device-sdk-c/src/port/bsp/raspberry/bluez/advertisement.c:21: /usr/include/glib-2.0/glib/gtypes.h: In function '_GLIB_CHECKED_ADD_U64': /usr/include/glib-2.0/glib/gmacros.h:738:31: error: static assertion failed: "Expression evaluates to false" #define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false") \^ /usr/include/glib-2.0/glib/gtypes.h:463:3: note: in expansion of macro 'G_STATIC_ASSERT' G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64)); \^ make\[2\]: \*\*\* \[src/CMakeFiles/iotcore.dir/build.make:193: src/CMakeFiles/iotcore.dir/port/bsp/raspberry/bluez/advertisement.c.o\] Error 1 make\[1\]: \*\*\* \[CMakeFiles/Makefile2:429: src/CMakeFiles/iotcore.dir/all\] Error 2 make: \*\*\* \[Makefile:130: all\] Error 2 解决办法: sudo apt-get install gcc-multilib g++-multilib sudo dpkg --add-architecture i386 sudo apt-get install libc6:i386 sudo apt-get install libglib2.0-0:i386 libglib2.0-dev:i386 #解决完以上问题后,使用以下步骤重新编译 export PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig:/usr/share/pkgconfig 删除build目录后,在项目根目录下重新执行 cmake -B build 或者 cmake -B build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 cd build make ![](https://i-blog.csdnimg.cn/direct/68ffcd7e459a4a138069acbd28f6dd4f.png)

相关推荐
同学小张10 小时前
【端侧AI 与 C++】1. llama.cpp源码编译与本地运行
开发语言·c++·aigc·llama·agi·ai-native
踢球的打工仔11 小时前
PHP面向对象(7)
android·开发语言·php
汤姆yu13 小时前
基于python的外卖配送及数据分析系统
开发语言·python·外卖分析
Yue丶越13 小时前
【C语言】字符函数和字符串函数
c语言·开发语言·算法
翔云 OCR API14 小时前
人脸识别API开发者对接代码示例
开发语言·人工智能·python·计算机视觉·ocr
V***u45314 小时前
MS SQL Server partition by 函数实战二 编排考场人员
java·服务器·开发语言
这是程序猿14 小时前
基于java的ssm框架旅游在线平台
java·开发语言·spring boot·spring·旅游·旅游在线平台
芳草萋萋鹦鹉洲哦15 小时前
【elemen/js】阻塞UI线程导致的开关卡顿如何优化
开发语言·javascript·ui
爱学习的小邓同学15 小时前
C++ --- 多态
开发语言·c++
颜*鸣&空15 小时前
QT实现串口通信+VSPD+串口调试工具
开发语言·qt