This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
先生,
我尝试从 MSYS2在 Windows 上构建 dfu-util。
我完成了所有步骤、但似乎无法链接 dll 文件。
指令是否正确、是否遗漏了任何步骤、或者操作方式有误?
此外、是否有预编译的 dfu-util for Windows 可以直接为 DFU 下载?
https://dfu-util.sourceforge.net/build.html
假设在 git 源代码上使用释放 tarball 或运行./autogen.sh。
首先从 MSYS2安装程序 主页安装 MSYS2。
为避免受到计算机上其他软件的干扰,请在运行升级命令之前在 MSYS 窗口中设置一条清除路径:
路径=/usr/local/bin:/usr/bin:/bin:/opt/bin pacman -Syu pacman -Su
关闭所有 MSYS 窗口、然后打开新窗口以安装工具链:
path=/usr/local/bin:/usr/bin:/bin:/opt/bin pacman -S MinGW-w64-x86_64-gcc pacman -S make
现在打开 MINGW64 shell 以构建 libusb 和 dfu-util:
path=/mingw64/bin:/usr/local/bin:/usr/bin:/bin cd libusb-1.0.24 ./configure --prefix=$PWD/../build make make install CD .. cd dfu-util-0.11 ./configure usb_CFLAGS="-i$PWD/../build/include/libusb-1.0 \ usb_libs="-L $PWD/../build/lib -lusb-1.0"--prefix=$PWD/../ build make install CD ..
若要静态地将 libusb 链接到 dfu-util.exe、请使用而不是仅使用"make":
使 LDFLAGS=-static
生成的可执行文件(和 DLL)现在将位于 build/bin 文件夹中。
BR、Rich
您好、Rich:
此处提供了适用于 Windows 的预编译 dfu-util 二进制文件。
https://dfu-util.sourceforge.net/releases/dfu-util-0.11-binaries.tar.xz
解压后、您将在如下所示的文件夹中找到预编译的二进制文件
~/Downloads/dfu-util-0.11-binaries/win64 ❯ ls -l dfu-util.exe -rwxr-xr-x 1 p-shivhare p-shivhare 870484 Sep 6 2021 dfu-util.exe
此致、
普拉桑特