IMX8MM -- Yocto构建遇见的错误及解决方法:

news2024/10/6 6:39:37

IMX8MM Yocto构建遇见的错误及解决方法:

  • 1 bison-3.0.4 error
  • 2 Opencv BB_NO_NETWORK Error :
  • 3 Yocto构建时出现U-boot 问题
  • 4 Yocto构建时出现Linux kernel编译问题
  • 5 wayland-native
  • 6 cross-localedef-native
  • 7 wayland-protocols
  • 8 mesa

硬件:米尔 IMX8MM

1 bison-3.0.4 error

| ../bison-3.0.4/lib/fseterr.c: In function 'fseterr':
| ../bison-3.0.4/lib/fseterr.c:77:3: error: #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."
|   #error "Please port gnulib fseterr.c to your platform! Look at the definitions of ferror and clearerr on your system, then report this to bug-gnulib."

解决方法:
进入bison-3.0.4目录,文件中进行替换和添加内容。
在 lib 目录下的所有以 .c 结尾的文件中,将字符串 IO_ftrylockfile 替换为 IO_EOF_SEEN,并在 lib/stdio-impl.h 文件末尾添加一个 C 语言宏定义
在这里插入图片描述

sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h

2 Opencv BB_NO_NETWORK Error :

ERROR: opencv-4.2.0.imx-r0 do_fetch: Network access disabled through
BB_NO_NETWORK (or set indirectly due to use of BB_FETCH_PREMIRRORONLY)
but access requested with command LANG=C git -c
core.fsyncobjectfiles=0 fetch -f --prune --progress
https://source.codeaurora.org/external/imx/opencv-imx.git
refs/:refs/ (for url
git://source.codeaurora.org/external/imx/opencv-imx.git;protocol=https;branch=4.2.0_imx;name=opencv)

在这里插入图片描述
当设置了 BB_NO_NETWORK 为 1 时,构建系统会禁止所有网络访问。这在一些场景下很有用,例如在没有互联网连接或者出于安全原因需要禁止网络访问的情况下。设置了 BB_NO_NETWORK 后,构建系统将不会尝试下载任何软件包或依赖项,而是会依赖本地缓存的文件。

解决
将 local.conf 文件里面的 BB_NO_NETWORK 设置删除或者设置为0

BB_NO_NETWORK  = “0”

3 Yocto构建时出现U-boot 问题

ERROR: u-boot-imx-2018.03-r0 do_fetch: Fetcher failure: Unable to
resolve ‘cc2c0393 14066949b84d48c035e9e08380ddc56dcb’ in upstream git
repository in git ls-remote out put for
//home/hufan/MYIR-i.MX8MM-Uboot ERROR: u-boot-imx-2018.03-r0 do_fetch:
Function failed: base_do_fetch ERROR: Logfile of failure stored in:
/media/hufan/new-im8xmm-20190527/build_8m_mini
_0706/tmp/work/myd_imx8mm-poky-linux/u-boot-imx/2018.03-r0/temp/log.do_fetch.18702
ERROR: Task
(/media/hufan/new-im8xmm-20190527/sources/meta-myir/meta-myir-bsp/recip
es-bsp/u-boot/u-boot-imx_2018.03.bb:do_fetch) failed with exit code
‘1’ ERROR: linux-imx-4.14.98-r0 do_fetch: Fetcher failure: Unable to
resolve ‘111d006bf 101e8aebab28acdd034d7fe1281c0e77c1’ in upstream git
repository in git ls-remote out put for
//home/hufan/MYIR-i.MX8MM-Linux ERROR: linux-imx-4.14.98-r0 do_fetch:
Function failed: base_do_fetch

解决:这种情况是由于U-Boot更新后,Yocto没有更新的对应的版本。
修改步骤如下:

1. 进⼊U-Boot源码⽬录,使⽤"git log"查看commit id。
2. 修改Yocto源码⽬录下的"source/meta-myir/meta-myir-bsp/recipes-bsp/u-boot/u-boot-imx_2018.03.bb"⽂
件中的SRCREV变量为查询到的commit id即可。

4 Yocto构建时出现Linux kernel编译问题

同样是Linux Kernel更新后,Yocto没有更新版本。修改步骤如下:

1. 进⼊Linux源码⽬录,使⽤"git log"查看commit id并复制
2. 修改Yocto源码⽬录下的"source/meta-myir/meta-myir-bsp/recipes-kernel/linux/linux-imx_4.14.98.bb"⽂
件中的SRCREV变量为commit id即可。

5 wayland-native

ERROR: wayland-native-1.17.0-r0 do_fetch: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS=“unix:path=/run/user/1000/bus,guid=c5a2e3679a31b7ffd15fafb165b85632”; export SSH_AGENT_PID=“1307”; export SSH_AUTH_SOCK=“/run/user/1000/keyring/ssh”; export ALL_PROXY=“socks5://172.16.112.237:1090”; export https_proxy=“http://127.0.0.1:7890”; export http_proxy=“http://127.0.0.1:7890”; export PATH=“/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/scripts/native-intercept:/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/scripts:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/bin/x86_64-linux:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/usr/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/recipe-sysroot-native/bin:/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/bitbake/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/hosttools”; export HOME=“/home/hh”; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -P /home/hh/MYIR-Yocto-i.MX8MM/downloads/ ‘https://wayland.freedesktop.org/releases/wayland-1.17.0.tar.xz’ --progress=dot -v failed with exit code 4, output:
–2024-01-30 03:15:48-- https://wayland.freedesktop.org/releases/wayland-1.17.0.tar.xz
Connecting to 127.0.0.1:7890… failed: Connection refused.
ERROR: wayland-native-1.17.0-r0 do_fetch: Fetcher failure for URL: ‘https://wayland.freedesktop.org/releases/wayland-1.17.0.tar.xz’. Unable to fetch URL from any source.
ERROR: wayland-native-1.17.0-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/wayland-native/1.17.0-r0/temp/log.do_fetch.12853
ERROR: Task (virtual:native:/home/hh/MYIR-Yocto-i.MX8MM/sources/meta-myir/meta-myir-bsp/recipes-graphics/wayland/wayland_1.17.0.bb:do_fetch) failed with exit code ‘1’

解决:
downloads 目录下面只有 wayland-1.16.0.tar.xz ,所有我自己去下载 1.17的版本放进去即可。
手动下载源代码包: 手动从浏览器或其他工具中下载 wayland-1.17.0.tar.xz,并将其放置在 Yocto 项目的 downloads 目录中。

6 cross-localedef-native

ERROR: cross-localedef-native-2.27-r0 do_compile: oe_runmake failed
ERROR: cross-localedef-native-2.27-r0 do_compile: Function failed: do_compile (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-localedef-native/2.27-r0/temp/log.do_compile.12121)
ERROR: Logfile of failure stored in: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-localedef-native/2.27-r0/temp/log.do_compile.12121
Log data follows:
| DEBUG: SITE files [‘endian-little’, ‘common-linux’, ‘common-glibc’, ‘bit-64’, ‘x86_64-linux’, ‘common’]
| DEBUG: Executing shell function do_compile
| NOTE: make -j 4
| gcc -isystem/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-telephone.o ld-time.o linereader.o localedef.o locarchive.o locfile.o record-status.o repertoire.o


parse.o argp-pv.o argp-xinl.o error.o getopt.o getopt1.o md5.o obstack.o asprintf.o getdelim.o localedef_extra.o obstack_printf.o vasprintf.o
| argp-fmtstream.o: In function _argp_fmtstream_update': | argp-fmtstream.c:(.text+0x231): undefined reference to _IO_fwide’
| argp-fmtstream.c:(.text+0x3e6): undefined reference to _IO_fwide' | argp-help.o: In function argp_failure’:
| argp-help.c:(.text+0x2123): undefined reference to `_IO_fwide’
| collect2: error: ld returned 1 exit status
| ERROR: oe_runmake failed
| Makefile:60: recipe for target ‘localedef’ failed
| make: *** [localedef] Error 1
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_compile (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/x86_64-linux/cross-localedef-native/2.27-r0/temp/log.do_compile.12121)
ERROR: Task (/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/meta/recipes-core/glibc/cross-localedef-native_2.27.bb:do_compile) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 817 tasks of which 730 didn’t need to be rerun and 1 failed.

解决:
在文件 cross-localedef-native_2.27.bb 里面添加 -D_IO_fwide=fwide。

CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'  -D_IO_fwide=fwide"

在这里插入图片描述

7 wayland-protocols

ERROR: wayland-protocols-1.17.imx-r0 do_fetch: Fetcher failure: Fetch
command export PSEUDO_DISABLED=1; export
DBUS_SESSION_BUS_ADDRESS=“unix:path=/run/user/1000/bus,guid=c5a2e3679a31b7ffd15fafb165b85632”; export SSH_AGENT_PID=“1307”; export
SSH_AUTH_SOCK=“/run/user/1000/keyring/ssh”; export
ALL_PROXY=“socks5://172.16.112.237:1090”; export
https_proxy=“http://127.0.0.1:7890”; export
http_proxy=“http://127.0.0.1:7890”; export
PATH=“/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/scripts:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/usr/bin/allarch-poky-linux:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot/usr/bin/crossscripts:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/usr/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/usr/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/sbin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/recipe-sysroot-native/bin:/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/bitbake/bin:/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/hosttools”;
export HOME=“/home/hh”; LANG=C git -c core.fsyncobjectfiles=0 fetch -f
–prune --progress https://source.codeaurora.org/external/imx/wayland-protocols-imx.git
refs/:refs/ failed with exit code 128, output: fatal: unable to
access
‘https://source.codeaurora.org/external/imx/wayland-protocols-imx.git/’:
Failed to connect to 127.0.0.1 port 7890: Connection refused ERROR:
wayland-protocols-1.17.imx-r0 do_fetch: Fetcher failure for URL:
‘git://source.codeaurora.org/external/imx/wayland-protocols-imx.git;protocol=https;branch=wayland-protocols-imx-1.17’.
Unable to fetch URL from any source. ERROR:
wayland-protocols-1.17.imx-r0 do_fetch: Function failed: base_do_fetch
ERROR: Logfile of failure stored in:
/home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/all-poky-linux/wayland-protocols/1.17.imx-r0/temp/log.do_fetch.20943
ERROR: Task
(/home/hh/MYIR-Yocto-i.MX8MM/sources/meta-myir/meta-myir-bsp/recipes-graphics/wayland/wayland-protocols_1.17.imx.bb:do_fetch)
failed with exit code ‘1’

解决:
主要是 https://source.codeaurora.org/external/imx/wayland-protocols-imx.git 这个网站进不去了屏蔽这个网站下载及去github下载,并将其放置在 Yocto 项目的 downloads 目录中即可。

过程:
使用grep 查看 source.codeaurora.org 在哪些文件,只修改有错误的文件。
在这里插入图片描述

在这里插入图片描述

删除后面部分即可。
在这里插入图片描述

从github下载
https://github.com/nxp-imx/wayland-protocols-imx
或者
https://coral.googlesource.com/wayland-protocols-imx/

或者官网下载
https://wayland.freedesktop.org/releases.html
下载下来应该是zip格式,解压缩后面,重新压缩为wayland-protocols-imx-1.17.tar.xz,并将其放置在 Yocto 项目的 downloads 目录中。

8 mesa

ERROR: mesa-2_17.3.8-r0 do_configure: configure failed
ERROR: mesa-2_17.3.8-r0 do_configure: Function failed: do_configure (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/temp/log.do_configure.26972)
ERROR: Logfile of failure stored in: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/temp/log.do_configure.26972
Log data follows:
| DEBUG: SITE files [‘endian-little’, ‘bit-64’, ‘arm-common’, ‘arm-64’, ‘common-linux’, ‘common-glibc’, ‘aarch64-linux’, ‘common’]
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing python function autotools_aclocals
| DEBUG: SITE files [‘endian-little’, ‘bit-64’, ‘arm-common’, ‘arm-64’, ‘common-linux’, ‘common-glibc’, ‘aarch64-linux’, ‘common’]
| DEBUG: Python function autotools_aclocals finished
| DEBUG: Executing shell function do_configure
| automake (GNU automake) 1.15.1


| checking for PTHREAD_PRIO_INHERIT… yes
| checking for libelf… no
| checking for elf_memory in -lelf… no
| …/mesa-17.3.8/configure: line 22925: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| …/mesa-17.3.8/configure: line 22908: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| …/mesa-17.3.8/configure: line 22927: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| …/mesa-17.3.8/configure: line 22928: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/llvm-config6.0: No such file or directory
| checking for libdrm >= 2.4.75… yes
| checking for glproto >= 1.4.14… yes
| checking for dri2proto >= 2.8… yes
| checking for xxf86vm… yes
| checking for x11 xext xdamage >= 1.1 xfixes x11-xcb xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8 xxf86vm… yes
| checking for wayland-scanner… /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/recipe-sysroot-native/usr/bin/wayland-scanner
| checking for wayland-client >= 1.11… yes
| checking for wayland-server >= 1.11… yes
| configure: error: wayland-protocols >= 1.8 is needed to compile the wayland platform
| NOTE: The following config.log files may provide further information.
| NOTE: /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/build/config.log
| ERROR: configure failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/hh/MYIR-Yocto-i.MX8MM/build_8m_mini/tmp/work/aarch64-mx8mm-poky-linux/mesa/2_17.3.8-r0/temp/log.do_configure.9383)
ERROR: Task (/home/hh/MYIR-Yocto-i.MX8MM/sources/poky/meta/recipes-graphics/mesa/mesa_17.3.8.bb:do_configure) failed with exit code ‘1’

https://archive.mesa3d.org//older-versions/17.x/

sudo apt-get install libelf-dev

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1514726.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

[论文精读]Dynamic Coarse-to-Fine Learning for Oriented Tiny Object Detection

论文网址:[2304.08876] 用于定向微小目标检测的动态粗到细学习 (arxiv.org) 论文代码:https://github.com/ChaselTsui/mmrotate-dcfl 英文是纯手打的!论文原文的summarizing and paraphrasing。可能会出现难以避免的拼写错误和语法错误&…

android MMKV数据持久化缓存集合

前言 最近在使用mmkv缓存的时候 发现没有集合缓存 非常不方便 自己写一个方法 MMKV public class MmkvUtils {private MmkvUtils() {throw new UnsupportedOperationException("u cant instantiate me...");}public static void init() {MMKV.initialize(LeoUtils…

C语言从入门到熟悉------第三阶段

数组 什么是数组呢?顾名思义数组就是很多数的组合!那么这些数有没有什么要求呢?是不是不管什么数组合在一起都是数组呢?第一,这些数的类型必须相同!第二,这些数在内存中必须是连续存储的。也就…

力扣思路题:重复的子字符串

注意比较j与j-i是否相同 bool repeatedSubstringPattern(char* s) {int i;int nstrlen(s);bool flag;for(int i1;i<n/2;i){if(n%i0){flagtrue;}for(int ji;j<n;j){if(s[j]!s[j-i]){flagfalse;break;}}if(flagtrue){return true;}}return false; }

Python爬虫基础学习-互联网、HTTP与HTML

互联网或者叫国际网&#xff08;Internet&#xff09;&#xff0c;是指网络与网络之间所串连成的庞大网络&#xff0c;这些网络以一组标准的网络TCP/IP协议族相连&#xff0c;连接全世界几十亿个设备&#xff0c;形成逻辑上的单一巨大国际网络。它是由从地方到全球范围内几百万…

【算法】一类支持向量机OC-SVM(2)

【算法】一类支持向量机OC-SVM&#xff08;2&#xff09; 前言纠正内容数据集创建方式适应度函数 新增内容散点图示例模型散点图展示 前言 在上则博文【算法】一类支持向量机OC-SVM&#xff08;1&#xff09; 中&#xff0c;我们提及到了蜂群算法优化一类支持向量机超参数模型…

gpt-4-all模型中转实现

最近才完成这个功能&#xff0c;相信知道这个模型的人&#xff0c;应该已经熟悉了。这是我的中转&#xff1a;openai-api Chatbox配置如下&#xff1a; 模型测试&#xff1a; 1&#xff09;图片生成 2&#xff09;文件分析&#xff0c;链接读取&#xff1a;

WWW2024 | PromptMM:Prompt-Tuning增强的知识蒸馏助力多模态推荐系统

论文&#xff1a;https://arxiv.org/html/2402.17188v1 代码&#xff1a;https://github.com/HKUDS/PromptMM 研究动机 多模态推荐系统极大的便利了人们的生活,比如亚马逊和Netflix都是基于多模态内容进行推荐的。对于研究,人们也遵循工业界的趋势,进行modality-aware的用户…

初步了解序列化和反序列化

01什么是序列化和反序列化 序列化是将对象转化为字符串以便存储的一种方式。而反序列化恰好是序列化的逆过程&#xff0c;反序列化会将字符串转化为对象供程序使用。 常见的php系列化和反系列化方式主要有&#xff1a;serialize&#xff0c;unserialize&#xff1b;json_enco…

删除元素.

C 用迭代器迭代&#xff0c;当条件成立删除元素。 class Solution { public:int removeElement(vector<int>& nums, int val) {for(std::vector<int>::iterator itnums.begin();it!nums.end();){if(*itval){itnums.erase(it);//vector删除时迭代器会失效&…

jenkins 使用k8s插件连接k8s集群

jenkins 安装k8s 插件 配置k8s节点 填写k8s 配置信息 生成秘钥 在服务器上面 查看地址 Kubernetes 服务证书 key cat /root/..kube/config 查看秘钥 对秘钥进行base64 位 加密 echo "秘钥内容" | base64 -d -----BEGIN CERTIFICATE----- MIIDITCCAgmgAwIB…

第一位 AI 程序员诞生,队友还是对手?

前几天&#xff0c;百度创始人李彦宏在采访中声称&#xff1a;“以后不会存在“程序员”这种职业了&#xff0c;因为只要会说话&#xff0c;人人都会具备程序员的能力”。 看到这话我的第一反应是“不可能&#xff0c;绝对不可能&#xff0c;程序员的工作有很大一部分是创造性的…

顺序表后续以及通讯录项目

⽬录 1. 基于动态顺序表实现通讯录项⽬ 2. 顺序表经典算法 3. 顺序表的问题及思考 正⽂开始 继上一篇 1.动态顺序表的查找 这里挺简单的如找不到就返回一个负数&#xff0c;因为索引不可能是负的这里就用来代表找不到 下面是找不到的示例 最终代码可以优化成这样 2.动态…

2024-03-13 作业

网络编程&#xff1a; 1.思维导图&#xff1a; 2.上课写的代码&#xff1a; 2.1网络字节序与主机字节序转换 运行代码&#xff1a; #include <myhead.h> int main() {int num 0x12345678;short int value 0x1234;int num_n htonl(num);int value_n htons(value);…

Window API 使用的一些注意事项

文章目录 1、LPCWSTR类型2、LPCTSTR类型3、LPCSTR类型4、LPCTSTR和LPCWSTR区别5、LPCTSTR和LPCSTR、LPCWSTR三者区别6、_T(" ")7、DWORD类型转换为std::wstring类型8、char类型转换为LPCSTR类型9、获取当前时间戳(毫秒)10、std::wstring和LPCSTR区别11、std::wstring…

鸿蒙Harmony应用开发—ArkTS声明式开发(基础手势:Toggle)

组件提供勾选框样式、状态按钮样式及开关样式。 说明&#xff1a; 该组件从API Version 8开始支持。后续版本如有新增内容&#xff0c;则采用上角标单独标记该内容的起始版本。 子组件 仅当ToggleType为Button时可包含子组件。 接口 Toggle(options: { type: ToggleType, is…

android studio 连接mumu模拟器调试

1、打开mumu模拟器 2、在Android Studio 中 控制台 cd 到 sdk 目录下 platform-tools 文件夹&#xff0c;有一个adb.exe 可运行程序 一般指令&#xff1a; adb connect 127.0.0.1:7555 但是这个执行在window环境下可能会报错 解决方法是在 adb 之前加 ".\", 问题…

精读《正交的 React 组件》

1 引言 搭配了合适的设计模式的代码&#xff0c;才可拥有良好的可维护性&#xff0c;The Benefits of Orthogonal React Components 这篇文章就重点介绍了正交性原理。 所谓正交&#xff0c;即模块之间不会相互影响。想象一个音响的音量与换台按钮间如果不是正交关系&#xf…

Java初阶数据结构队列的实现

1.队列的概念 1.队列就是相当于排队打饭 2.在排队的时候就有一个队头一个队尾。 3.从队尾进对头出 4.所以他的特点就是先进先出 所以我们可以用链表来实现 单链表实现要队尾进队头出{要有last 尾插头删} 双向链表实现效率高&#xff1a;不管从哪个地方当作队列都是可以的&…

学习JAVA的第二十一天(基础)

多线程 线程&#xff1a; 线程是操作系统能够进行运算调度的最小单位。它被包含在进程之中&#xff0c;是进程中的实际运作单位。 进程&#xff1a; 程序的基本执行实体 并发&#xff1a; 在同一时刻&#xff0c;有多个指令在单个CPU上交替执行 并行&#xff1a; 在同一时刻&…