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

相关推荐
西阳未落13 小时前
C++基础(21)——内存管理
开发语言·c++·面试
我的xiaodoujiao13 小时前
Windows系统Web UI自动化测试学习系列2--环境搭建--Python-PyCharm-Selenium
开发语言·python·测试工具
callJJ14 小时前
从 0 开始理解 Spring 的核心思想 —— IoC 和 DI(2)
java·开发语言·后端·spring·ioc·di
超级大福宝14 小时前
使用 LLVM 16.0.4 编译 MiBench 中的 patricia遇到的 rpc 库问题
c语言·c++
hsjkdhs15 小时前
万字详解C++之构造函数析构函数
开发语言·c++
Lin_Aries_042116 小时前
容器化简单的 Java 应用程序
java·linux·运维·开发语言·docker·容器·rpc
techdashen16 小时前
12分钟讲解Python核心理念
开发语言·python
闭着眼睛学算法16 小时前
【华为OD机考正在更新】2025年双机位A卷真题【完全原创题解 | 详细考点分类 | 不断更新题目 | 六种主流语言Py+Java+Cpp+C+Js+Go】
java·c语言·javascript·c++·python·算法·华为od
山海不说话16 小时前
Java后端面经(八股——Redis)
java·开发语言·redis
郝学胜-神的一滴17 小时前
谨慎地迭代函数所收到的参数 (Effective Python 第31条)
开发语言·python·程序人生·软件工程