基于MingGW64 GCC编译Windows平台上的 libuvc
安装cmake
打开cmake官网 https://cmake.org/download/,下载安装包:
安装时选择将cmake加到系统环境变量里。安装完成后在新的CMD命令窗口执行cmake --version可看到输出:
D:\>cmake --version
cmake version 3.29.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
安装Mingw64 GCC
Mingw目标是为支持Windows平台上的GCC编译,它主要提供头文件和支持库,Mingw自身不包括GCC和binutils,所以官网提供了集成这些组件的各种安装包。列表里有Linux平台的安装包,那些是用来在Linux平台生成Widows程序的。
https://www.mingw-w64.org/
这里我选择了w64devkit,点击后安装链接指向了github:https://github.com/skeeto/w64devkit/releases ,下载w64devkit-1.23.0.zip。
解压后放在C盘,将目录 C:\w64devkit\bin\ 加入系统PATH环境变量。
然后新打开的CMD命令窗口输入gcc –v 可以看到输出:
D:\>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=C:/w64devkit/bin/../libexec/gcc/x86_64-w64-mingw32/14.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: /gcc-14.1.0/configure --prefix=/w64devkit --with-sysroot=/w64devkit/x86_64-w64-mingw32 --with-native-system-header-dir=/include --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --with-pic --with-gmp-include=/deps/include --with-gmp-lib=/deps/lib --with-mpc-include=/deps/include --with-mpc-lib=/deps/lib --with-mpfr-include=/deps/include --with-mpfr-lib=/deps/lib --enable-languages=c,c++ --enable-libgomp --enable-threads=posix --enable-version-specific-runtime-libs --disable-dependency-tracking --disable-lto --disable-multilib --disable-nls --disable-win32-registry --enable-mingw-wildcard CFLAGS_FOR_TARGET=-Os CXXFLAGS_FOR_TARGET=-Os LDFLAGS_FOR_TARGET=-s CFLAGS=-Os CXXFLAGS=-Os LDFLAGS=-s
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.1.0 (GCC)
下载libusb
Libuvc依赖libusb,libusb是一个低级的通用访问USB设备的用户空间库。我们直接下载官网已经编译好的二进制库。
https://libusb.info/
点击图中Latest Windows Binaries下载 https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.7z 解压后将 include\libusb.h, MinGW64下面的 .a 及 .dll 库提取到一个目录,如D:\libusb:
下载编译libuvc
https://github.com/libuvc/libuvc
从官网以git clone下载源码,源码所放位置为D:\libuvc
由于cmake最小版本过低会产生如下告警:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):Compatibility with CMake < 3.5 will be removed from a future version ofCMake.Update the VERSION argument <min> value or use a ...<max> suffix to tellCMake that the project does not need compatibility with older versions.
所以我们把libuvc/CmakeList.txt开头的cmake最低版本改为3.10
如果直接执行cmake .. 会提示找不到libusb,打开D:\libuvc\CmakeLists.txt,删除find_package(LibUSB)一行,替换为下面内容(目录分隔符这里用的是 /, 如果用 \ 分隔,转义的原因还要改为 \\):
# Locate the libusb-1.0 package manually if not found
#find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h PATH_SUFFIXES libusb-1.0)
#find_library(LIBUSB_LIBRARY NAMES usb-1.0 libusb-1.0)
set(LIBUSB_INCLUDE_DIR D:/libusb)
set(LIBUSB_LIBRARY D:/libusb/libusb-1.0.dll D:/libusb/libusb-1.0.dll.a)
#set(LIBUSB_LIBRARY D:/libusb/libusb-1.0.a) # for static linkif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARY)set(LIBUSB_FOUND TRUE)
else()set(LIBUSB_FOUND FALSE)message(WARNING "LibUSB not found. Please install it.")
endif()
静态链接用lbusb-1.0.a就注释掉46行,打开47行, 这样会更方便一点,不会产生找不到dll的问题。
然后在130行左右添加libusb.h头文件目录和链接库,
打开CMD窗口,执行下面命令:
cd D:\libuvc
mkdir build install
cd build
rm –fr *; #如果cmake有错,重新执行时建议把目录清空。
cmake -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\libuvc\install -DBUILD_SHARED_LIBS=ON ..
第一次执行cmake报错, 系统会报病毒拦截,再执行一次上面的cmake 命令即可。 不确定是误报还是真有病毒。
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/CMakeDetermineCompilerId.cmake:922 (file):file STRINGS file "D:/libuvc/build/CMakeFiles/3.29.3/CompilerIdC/a.exe"cannot be read.
执行cmake成功后生成Makefie,接下来执行make命令进行编译。编译过程中会提示ARRAYSIZE重复定义的警告:
D:/libuvc/include/libuvc/libuvc_internal.h:75:9: warning: "ARRAYSIZE" redefined75 | #define ARRAYSIZE(arr) (sizeof(arr) / (IS_ARRAY(arr) ? sizeof(arr[0]) : 0))| ^~~~~~~~~
In file included from C:/w64devkit/x86_64-w64-mingw32/include/minwindef.h:163,from C:/w64devkit/x86_64-w64-mingw32/include/windef.h:9,from C:/w64devkit/x86_64-w64-mingw32/include/windows.h:69,from D:/libusb/libusb.h:64,from D:/libuvc/include/libuvc/libuvc_internal.h:14:
C:/w64devkit/x86_64-w64-mingw32/include/winnt.h:681:
note: this is the location of the previous definition681 | #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
如果不想看到太多输出警告信息,可以编辑D:\libuvc\include\libuvc\libuvc_internal.h, 在ARRAYSIZE外面加上#ifndef ARRAYSIZE 进行防御。
编译成功:
D:\libuvc\build>make
[ 5%] Building C object CMakeFiles/uvc.dir/src/ctrl.c.obj
[ 10%] Building C object CMakeFiles/uvc.dir/src/ctrl-gen.c.obj
[ 15%] Building C object CMakeFiles/uvc.dir/src/device.c.obj
[ 20%] Building C object CMakeFiles/uvc.dir/src/diag.c.obj
[ 25%] Building C object CMakeFiles/uvc.dir/src/frame.c.obj
[ 30%] Building C object CMakeFiles/uvc.dir/src/init.c.obj
[ 35%] Building C object CMakeFiles/uvc.dir/src/stream.c.obj
[ 40%] Building C object CMakeFiles/uvc.dir/src/misc.c.obj
[ 45%] Linking C shared library libuvc.dll
[ 45%] Built target uvc
[ 50%] Building C object CMakeFiles/uvc_static.dir/src/ctrl.c.obj
[ 55%] Building C object CMakeFiles/uvc_static.dir/src/ctrl-gen.c.obj
[ 60%] Building C object CMakeFiles/uvc_static.dir/src/device.c.obj
[ 65%] Building C object CMakeFiles/uvc_static.dir/src/diag.c.obj
[ 70%] Building C object CMakeFiles/uvc_static.dir/src/frame.c.obj
[ 75%] Building C object CMakeFiles/uvc_static.dir/src/init.c.obj
[ 80%] Building C object CMakeFiles/uvc_static.dir/src/stream.c.obj
[ 85%] Building C object CMakeFiles/uvc_static.dir/src/misc.c.obj
[ 90%] Linking C static library libuvc.a
[ 90%] Built target uvc_static
[ 95%] Building C object CMakeFiles/example.dir/src/example.c.obj
[100%] Linking C executable example.exe
[100%] Built target example
然后安装到install目录,
D:\libuvc\build>make install
[ 45%] Built target uvc
[ 90%] Built target uvc_static
[100%] Built target example
Install the project...
-- Install configuration: "Release"
-- Installing: D:/libuvc/install/lib/libuvc.dll.a
-- Installing: D:/libuvc/install/bin/libuvc.dll
-- Installing: D:/libuvc/install/include/libuvc/libuvc.h
-- Installing: D:/libuvc/install/include/libuvc/libuvc_config.h
-- Installing: D:/libuvc/install/lib/libuvc.a
-- Up-to-date: D:/libuvc/install/include/libuvc/libuvc.h
-- Up-to-date: D:/libuvc/install/include/libuvc/libuvc_config.h
-- Installing: D:/libuvc/install/lib/cmake/libuvc/libuvcTargets.cmake
-- Installing: D:/libuvc/install/lib/cmake/libuvc/libuvcTargets-release.cmake
-- Installing: D:/libuvc/install/lib/cmake/libuvc/FindLibUSB.cmake
-- Installing: D:/libuvc/install/lib/cmake/libuvc/FindJpegPkg.cmake
-- Installing: D:/libuvc/install/lib/cmake/libuvc/libuvcConfigVersion.cmake
-- Installing: D:/libuvc/install/lib/pkgconfig/libuvc.pc
-- Installing: D:/libuvc/install/lib/cmake/libuvc/libuvcConfig.cmake
测试
以example.exe来进行测试。
首先利用USBDeview (https://usbdeview.me)工具找到电脑上外置UVC摄像头的VID和PID。
然后打开D:\libuvc\src\example.c, 修改其中的VID和PID:
重新在build目录执行make,然后执行example.exe, 会提示找不到libusb-1.0.dll,可以将D:\libusb-1.0.dll复制一份放在example.exe同一个目录。 或者一劳永逸的复制到C:\Windows\System32下。 如果给别人发编译好的程序,需要带上libusb-1.0.dll。若前面Cmake配置静态链接libusb则没有此麻烦。
解决完dll问题后,example跑起来会报错,找不到设备:
D:\libuvc\build>example.exe
UVC initialized
Device found
uvc_open: Not found (-5)
UVC exited
先用USBDeview查看驱动,此UVC设备使用了usbvideo驱动,需要安装WinUSB驱动。
https://learn.microsoft.com/zh-cn/windows-hardware/drivers/usbcon/winusb-installation 面向开发人员的 WinUSB (Winusb.sys) 安装 文档中描述到:
对于某些通用串行总线 (USB) 设备(例如仅由单个应用程序访问的设备),可以在设备的内核模式堆栈中安装 WinUSB (Winusb.sys) 作为 USB 设备的功能驱动程序,而不是实现驱动程序。libusb正是此种场景。可以认为WinUSB.sys驱动是一种低层次的驱动,libusb要跟低层的驱动打交道,usbvideo.sys驱动是高层次的驱动。可以31按链接中微软官方的指导安装WinUSB驱动,也可以用Zadig来安装此驱动。
从 https://zadig.akeo.ie下载Zadig。由于在此电脑上,USB Camera(Interface 0)是Video类型,USB Camera(Interface 2)是Audio类型, 所以在从Options菜单中选择List All Devices后选择USB Camera(Interface 0),换用WinUSB驱动。
安装WinUSB驱动后用USBDeview查看:
example跑成功的日志:
D:\libuvc\build>example.exeUVC initialized
Device found
Device openedDEVICE CONFIGURATION (b349:b182/[none]) ---
Status: idle
VideoControl:bcdUVC: 0x0100VideoStreaming(1):bEndpointAddress: 129Formats:UncompressedFormat(1)bits per pixel: 16GUID: 5955593200001000800000aa00389b71 (YUY2)default frame: 1aspect ratio: 0x0interlace flags: 00copy protect: 00FrameDescriptor(1)capabilities: 01size: 1600x1200bit rate: 153600000-153600000max frame size: 3840000default interval: 1/5interval[0]: 1/5FrameDescriptor(2)capabilities: 01size: 1280x720bit rate: 110592000-110592000max frame size: 1843200default interval: 1/7interval[0]: 1/7FrameDescriptor(3)capabilities: 01size: 640x480bit rate: 147456000-147456000max frame size: 614400default interval: 1/30interval[0]: 1/30MJPEGFormat(2)bits per pixel: 0GUID: 4d4a5047000000000000000000000000 (MJPG)default frame: 1aspect ratio: 0x0interlace flags: 00copy protect: 00FrameDescriptor(1)capabilities: 01size: 1600x1200bit rate: 921600000-921600000max frame size: 3840000default interval: 1/30interval[0]: 1/30FrameDescriptor(2)capabilities: 01size: 1280x720bit rate: 442368000-442368000max frame size: 1843200default interval: 1/30interval[0]: 1/30FrameDescriptor(3)capabilities: 01size: 640x480bit rate: 147456000-147456000max frame size: 614400default interval: 1/30interval[0]: 1/30
END DEVICE CONFIGURATION
First format: (YUY2) 1600x1200 5fps
bmHint: 0001
bFormatIndex: 1
bFrameIndex: 1
dwFrameInterval: 2000000
wKeyFrameRate: 0
wPFrameRate: 0
wCompQuality: 61
wCompWindowSize: 0
wDelay: 0
dwMaxVideoFrameSize: 3840000
dwMaxPayloadTransferSize: 3060
bInterfaceNumber: 1
Streaming...
Enabling auto exposure ...... full AE not supported, trying aperture priority mode... enabled aperture priority auto exposure mode
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
callback! frame_format = 3, width = 1600, height = 1200, length = 3840000, ptr = 0000000000003039
Done streaming.
Device closed
UVC exited
恢复驱动
安装过WinUSB驱动的UVC设备,不会出现在设备管理器的照像机下面。 如果要恢复正常的UVC Camera功能,可以在设备管理器中卸载此设备的驱动。
卸载驱动后在设备管理器中右击鼠标,扫描检测硬件改动,USB Camera可以自动识别出来。驱动也恢复为原来的usbvideo.sys。
相关文章:

基于MingGW64 GCC编译Windows平台上的 libuvc
安装cmake 打开cmake官网 https://cmake.org/download/,下载安装包: 安装时选择将cmake加到系统环境变量里。安装完成后在新的CMD命令窗口执行cmake --version可看到输出: D:\>cmake --version cmake version 3.29.3 CMake suite mainta…...

【Linux】网络高级IO
欢迎来到Cefler的博客😁 🕌博客主页:折纸花满衣 🏠个人专栏:Linux 目录 👉🏻五种IO模型👉🏻消息通信的同步异步与进程线程的同步异步有什么不同?👉…...

【C++ ——— 继承】
文章目录 继承的概念即定义继承概念继承定义定义格式继承关系和访问限定符继承基类成员访问方式的变化 基类对象和派生类对象的赋值转换继承中的作用域派生类中的默认成员函数继承与友元继承与静态成员菱形继承虚继承解决数据冗余和二义性的原理继承的总结继承常见笔试面试题 继…...

kafka-守护启动
文章目录 1、kafka守护启动1.1、先启动zookeeper1.1.1、查看 zookeeper-server-start.sh 的地址1.1.2、查看 zookeeper.properties 的地址 1.2、查看 jps -l1.3、再启动kafka1.3.1、查看 kafka-server-start.sh 地址1.3.2、查看 server.properties 地址 1.4、再次查看 jps -l 1…...
TypeScript 中的命名空间和模块化
1. 命名空间(Namespace) 命名空间提供了一种逻辑上的代码分组机制,用于避免命名冲突和将相关代码组织在一起。它使用 namespace 关键字来定义命名空间,并通过点运算符来访问其中的成员。例如: // 定义命名空间 names…...
9 html综合案例-注册界面
9 综合案例-注册界面 一个只有html骨架的注册页面 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>…...

Xilinx RFSOC 47DR 8收8发 信号处理板卡
系统资源如图所示: FPGA采用XCZU47DR 1156芯片,PS端搭载一组64Bit DDR4,容量为4GB,最高支持速率:2400MT/s; PS端挂载两片QSPI X4 FLASH; PS支持一路NVME存储; PS端挂载SD接口,用于存储程序&…...
ros2 launch 用法以及一些基础功能函数的示例
文章目录 launch启动一个节点的launch示例launch文件中添加节点的namespacelaunch文件中的话题名称映射launch文件中向节点内传入命令行参数launch文件中向节点内传入rosparam使用方法多节点启动命令行参数配置资源重映射ROS参数设置加载参数文件在launch文件中使用条件变量act…...
如何使用Python获取图片中的文字信息
如下有三中方法: 方法1. 使用Tesseract OCR(pytesseract) 安装依赖 首先,确保你已经安装了Tesseract OCR引擎(例如,通过你的操作系统的包管理器)。然后,你可以通过pip安装pytesse…...
C++知识点
1. 构造函数:当没有写任何构造函数(含拷贝构造),系统会生成默认的无参构造,并且访问属性是共有。 默认拷贝构造:当没有写任何的拷贝构造,系统会生成默认的拷贝构造->是一个浅拷贝 写了拷贝构造函数,这…...
反转字符串中的单词-力扣
此题将问题分为三步进行解决: 第一步,删除字符串中多余的空格,removeSpaces函数中删除所有的空格,并手动在每个单词后添加一个空格,最后重构字符串s第二步,将整个字符串反转第三步,对反转后的字…...
Kotlin 重写与重载
文章目录 重写(Override)重载(Overload) 重写(Override) 重写通常是指子类覆盖父类的属性或方法,通常会标记为override: open class Base {open val name "Base"open f…...

关于高版本 Plant Simulation 每次保存是 提示提交comm对话框的处理方法
关于高版本 Plant Simulation 每次保存是 提示提交comm对话框的处理方法 如下图 将model saving history 修改为None即可 关于AutoCAD 2022 丢失模板库的问题 从新从以下地址打开即可: D:\Program Files\Autodesk\AutoCAD 2022\UserDataCache\zh-cn\Template...

C语言之旅:探索单链表
目录 一、前言 二、实现链表的功能: 打印 创建节点 尾插 尾删 头插 头删 查找 在指定位置之前插入数据 指定位置删除 在指定位置之后插入数据 打印 销毁 三、全部源码: 四、结语 一、前言 链表是一个强大且基础的数据结构。对于很多初…...
【安卓基础】-- 消息机制 Handler
目录 消息机制 Handler面试问题 消息机制 Handler 对handler机制的基本作用、用法、时序流程进行介绍,针对handler机制中的内存泄漏问题讲解:一篇读懂Android Handler机制 Android-Handler机制详解 全面解析 | Android之Handler机制 需要掌握的&#x…...
Optional 类
概述 到目前为止,臭名昭著的空指针异常是导致 Java 应用程序失败的最常见原因。以前,为了解决空指针异常,Google 公司著名的 Guava 项目引入了 Optional 类, Guava 通过使用检查空值的方式来防止代码污染,它鼓励程序员…...

自动微分技术在 AI for science 中的应用
本文简记我在学习自动微分相关技术时遇到的知识点。 反向传播和自动微分 以 NN 为代表的深度学习技术展现出了强大的参数拟合能力,人们通过堆叠固定的 layer 就能轻松设计出满足要求的参数拟合器。 例如,大部分图神经网络均基于消息传递的架构。在推理…...
ASM OMF single-file creation form 重命名
OMF下不能自动命名,需要重新命名的话:1 1. spfile 可以 create pfile from spfile 后再create spfile from pfile 2 redo? 3 datafile? Here are some details of the copy problem: a) You are not allowed to set the numbe…...

VGGNet
VGGNet CNN卷积网络的发展史 1. LetNet5(1998) 2. AlexNet(2012) 3. ZFNet(2013) 4. VGGNet(2014) 5. GoogLeNet(2014) 6. ResNet(2015) 7. DenseNet(2017) 8. EfficientNet(2019) 9. Vision Transformers(2020) 10. 自适应卷积网络(2021) 上面列出了发展到现在CNN的一些经典…...

SpringMVC:转发和重定向
1. 请求转发和重定向简介 参考该链接第9点 2. forward 返回下一个资源路径,请求转发固定格式:return "forward:资源路径"如 return "forward:/b" 此时为一次请求返回逻辑视图名称 返回逻辑视图不指定方式时都会默认使用请求转发in…...

深入浅出Asp.Net Core MVC应用开发系列-AspNetCore中的日志记录
ASP.NET Core 是一个跨平台的开源框架,用于在 Windows、macOS 或 Linux 上生成基于云的新式 Web 应用。 ASP.NET Core 中的日志记录 .NET 通过 ILogger API 支持高性能结构化日志记录,以帮助监视应用程序行为和诊断问题。 可以通过配置不同的记录提供程…...

基于uniapp+WebSocket实现聊天对话、消息监听、消息推送、聊天室等功能,多端兼容
基于 UniApp + WebSocket实现多端兼容的实时通讯系统,涵盖WebSocket连接建立、消息收发机制、多端兼容性配置、消息实时监听等功能,适配微信小程序、H5、Android、iOS等终端 目录 技术选型分析WebSocket协议优势UniApp跨平台特性WebSocket 基础实现连接管理消息收发连接…...
Go 语言接口详解
Go 语言接口详解 核心概念 接口定义 在 Go 语言中,接口是一种抽象类型,它定义了一组方法的集合: // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的: // 矩形结构体…...
【算法训练营Day07】字符串part1
文章目录 反转字符串反转字符串II替换数字 反转字符串 题目链接:344. 反转字符串 双指针法,两个指针的元素直接调转即可 class Solution {public void reverseString(char[] s) {int head 0;int end s.length - 1;while(head < end) {char temp …...
VTK如何让部分单位不可见
最近遇到一个需求,需要让一个vtkDataSet中的部分单元不可见,查阅了一些资料大概有以下几种方式 1.通过颜色映射表来进行,是最正规的做法 vtkNew<vtkLookupTable> lut; //值为0不显示,主要是最后一个参数,透明度…...
C++.OpenGL (14/64)多光源(Multiple Lights)
多光源(Multiple Lights) 多光源渲染技术概览 #mermaid-svg-3L5e5gGn76TNh7Lq {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-3L5e5gGn76TNh7Lq .error-icon{fill:#552222;}#mermaid-svg-3L5e5gGn76TNh7Lq .erro…...

华为OD机考-机房布局
import java.util.*;public class DemoTest5 {public static void main(String[] args) {Scanner in new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextLine()) { // 注意 while 处理多个 caseSystem.out.println(solve(in.nextLine()));}}priv…...
解决:Android studio 编译后报错\app\src\main\cpp\CMakeLists.txt‘ to exist
现象: android studio报错: [CXX1409] D:\GitLab\xxxxx\app.cxx\Debug\3f3w4y1i\arm64-v8a\android_gradle_build.json : expected buildFiles file ‘D:\GitLab\xxxxx\app\src\main\cpp\CMakeLists.txt’ to exist 解决: 不要动CMakeLists.…...

实战设计模式之模板方法模式
概述 模板方法模式定义了一个操作中的算法骨架,并将某些步骤延迟到子类中实现。模板方法使得子类可以在不改变算法结构的前提下,重新定义算法中的某些步骤。简单来说,就是在一个方法中定义了要执行的步骤顺序或算法框架,但允许子类…...
深入理解 React 样式方案
React 的样式方案较多,在应用开发初期,开发者需要根据项目业务具体情况选择对应样式方案。React 样式方案主要有: 1. 内联样式 2. module css 3. css in js 4. tailwind css 这些方案中,均有各自的优势和缺点。 1. 方案优劣势 1. 内联样式: 简单直观,适合动态样式和…...