君正交叉编译链工具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)

相关推荐
один but you10 小时前
从可变参数到 emplace:现代 C++ 性能优化的核心组合
java·开发语言
MY_TEUCK11 小时前
【Java 后端 | Nacos 注册中心】微服务治理原理、选型与注册发现实战
java·开发语言·微服务
测试员周周11 小时前
【Appium 系列】第13节-混合测试执行器 — API + UI 的协同执行
开发语言·人工智能·python·功能测试·ui·appium·pytest
光泽雨12 小时前
c#中的Type类型
开发语言·前端
见叶之秋12 小时前
C++基础入门指南
开发语言·c++
计算机安禾12 小时前
【c++面向对象编程】第42篇:模板特化与偏特化:为特定类型定制实现
开发语言·c++·算法
qq_4017004112 小时前
Qt 项目中使用 QSS 的全面总结
开发语言·qt
浩浩测试一下12 小时前
汇编 标志位寄存器 (逆向分析 )
c语言·汇编·逆向·windows编程·标志寄存器
玖釉-12 小时前
C++ 中的循环语句详解:while、do...while、for、嵌套循环与循环控制
开发语言·c++·算法
XMYX-013 小时前
37 - Go env 环境变量:配置管理与运行时控制
开发语言·golang