吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 243|回复: 10
收起左侧

[其他求助] 求助,把git一个用C++写的项目转成win 11 能用的exe

[复制链接]
freckle 发表于 2025-12-12 15:06
150吾爱币
git地址
https://github.com/smithjd15/playlist
好像是C++写的

AboutA tool for converting, inspecting, and modifying media playlists. It can transform playlist targets into relative or absolute paths, and insert, append, reorder, remove or change entries. It can remove duplicate and unfound entries, randomize the order of entries and can convert between asx, cue, jspf, m3u, pls, wpl and xspf playlist formats.
一个用于转换、检查和修改媒体播放列表的工具。它可以将播放列表目标转换为相对或绝对路径,并插入、添加、重排、删除或更改条目。它可以去除重复和未找到的条目,随机条目顺序,并且可以在 asx、cue、jspf、m3u、pls、wpl 和 xspf 播放列表格式之间转换。

自己没有相关工具软件,在网上搜了半天如何转,没看懂

需求:
转成windows 11能用的程序。
下载的代码:
https://wwbhh.lanzouw.com/iaPh53dfwr9a

最佳答案

查看完整内容

https://parap.lanzouq.com/insCA3dkqquj 动态链接dll 好像有问题 换为静态 [md]## Windows 平台构建说明 ### 前置要求 - [w64devkit](https://github.com/skeeto/w64devkit) (MinGW-w64 工具链) - [vcpkg](https://github.com/microsoft/vcpkg) (C++ 包管理器) - CMake 3.15 或更高版本 ### 步骤 1:安装依赖 使用 vcpkg 安装所需的依赖,使用 `x64-mingw-static` 三元组(静态链接,无需 DLL): ```bash ...

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| freckle 发表于 2025-12-12 19:09
下载了需要的库
pugixml-1.15
rapidjson-1.1.0
mingw-w64 15.2.0
cmake-4.2.1

https://wwbhh.lanzouw.com/b02ij19cve
密码:59nl
装了Visual Studio,cmake,下了库,让Trae CN编译,它说源代码有问题,那就让它改,越改越错
哪位大神出手给编译下,弄了一个下午了到现在,俺实在是不懂,哪哪都冒错
pzx521521 发表于 2025-12-12 15:06
https://parap.lanzouq.com/insCA3dkqquj
动态链接dll 好像有问题
换为静态

Windows 平台构建说明

前置要求

  • w64devkit (MinGW-w64 工具链)
  • vcpkg (C++ 包管理器)
  • CMake 3.15 或更高版本

步骤 1:安装依赖

使用 vcpkg 安装所需的依赖,使用 x64-mingw-static 三元组(静态链接,无需 DLL):

vcpkg install --triplet x64-mingw-static

这将安装 vcpkg.json 中指定的依赖:

  • pugixml - XML 解析库
  • rapidjson - JSON 解析库

步骤 2:配置 CMake

使用 MinGW 和 vcpkg 配置构建系统。请根据你的实际安装路径替换以下路径:

cmake -B build -S . ^
  -G "MinGW Makefiles" ^
  -DCMAKE_C_COMPILER=C:/w64devkit/bin/x86_64-w64-mingw32-gcc.exe ^
  -DCMAKE_CXX_COMPILER=C:/w64devkit/bin/x86_64-w64-mingw32-g++.exe ^
  -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg-tool-main/scripts/buildsystems/vcpkg.cmake ^
  -DVCPKG_TARGET_TRIPLET=x64-mingw-static

注意: 请根据你的系统调整以下路径:

  • C:/w64devkit/bin/ - 你的 w64devkit 安装路径
  • D:/vcpkg-tool-main/scripts/buildsystems/vcpkg.cmake - 你的 vcpkg 安装路径

步骤 3:构建

构建项目:

cmake --build build

可执行文件 playlist.exe 将在 build 目录中创建。由于使用静态链接,所有依赖都已包含在可执行文件中,无需额外的 DLL 文件。

吾爱_zxl 发表于 2025-12-12 16:48
看了下。以为很简单。然后发现依赖了pugixml、RapidJSON、libcurl、TAGLIB 而且还没法直接用对应的cmake直接编
算了算了
PhiFever 发表于 2025-12-12 17:11
[Bash shell] 纯文本查看 复制代码
➜  playlist git:(main) mkdir build && cd build
➜  build git:(main) cmake ..
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  CMake 4.0 or higher is required.  You are running version 3.28.3
-- Configuring incomplete, errors occurred!
➜  build git:(main) ✗ cmake --version
cmake version 3.28.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

➜  build git:(main) ✗ sudo apt update && sudo apt-get install cmake g++ libpugixml-dev rapidjson-dev libcurl4-openssl-dev libtag1-dev

...
➜  build git:(main) ✗ vi ../CMakeLists.txt
# 此处需要修改第一行的版本号 4.0->3.0
➜  build git:(main) ✗ cmake ..
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 13.3.0
-- The CXX compiler identification is GNU 13.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found RapidJSON: /usr/include/rapidjson
-- Found CURL: /usr/lib/aarch64-linux-gnu/libcurl.so (found version "8.5.0")
-- Found TagLib: /usr/lib/aarch64-linux-gnu/libtag.so
-- Configuring done (3.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/pi/playlist/build
&#10140;  build git:(main) &#10007; ls
CMakeCache.txt  CMakeFiles  Makefile  cmake_install.cmake
&#10140;  build git:(main) &#10007; make
[ 10%] Building CXX object CMakeFiles/playlist.dir/src/main.cpp.o
[ 20%] Building CXX object CMakeFiles/playlist.dir/src/playlist.cpp.o
[ 30%] Building CXX object CMakeFiles/playlist.dir/src/asx.cpp.o
[ 40%] Building CXX object CMakeFiles/playlist.dir/src/cue.cpp.o
[ 50%] Building CXX object CMakeFiles/playlist.dir/src/jspf.cpp.o
[ 60%] Building CXX object CMakeFiles/playlist.dir/src/m3u.cpp.o
[ 70%] Building CXX object CMakeFiles/playlist.dir/src/pls.cpp.o
[ 80%] Building CXX object CMakeFiles/playlist.dir/src/wpl.cpp.o
[ 90%] Building CXX object CMakeFiles/playlist.dir/src/xspf.cpp.o
[100%] Linking CXX executable playlist
[100%] Built target playlist
&#10140;  build git:(main) &#10007; ls
CMakeCache.txt  CMakeFiles  Makefile  cmake_install.cmake  playlist
&#10140;  build git:(main) &#10007; ./playlist
Nothing to do!
playlist -h for usage information
&#10140;  build git:(main) &#10007; ./playlist -h
playlist version 2.8
Copyright (C) James D. Smith

Usage: playlist [-l|-L|-P|-J|-S|-K|-C|-A|-T|-M|-E|-D|-G|-N dupe|image|net|netimg|target|unfound|unfoundimg|unique] [-p] [-f path] [-z] [[-O|-I]|[-R|-B path]] [-c trackpos:track] [-a [track:]target] [-e track:FIELD=value] [-r track|target] [-s] [-i] [-d] [-u] [-j] [-n] [-m] [-b artist] [-k comment] [-g image] [-t title] [-q] [-v] [-x] [-o] [-w outfile.ext] infile...

Options:
        -l LIST Targets only
        -L LIST Tracks and targets
        -P LIST Playlist and targets
        -J LIST Playlist title and targets
        -S LIST Playlist artist and targets
        -K LIST Playlist image and targets
        -C LIST Playlist comment and targets
        -A LIST Artists and targets
        -T LIST Titles and targets
        -M LIST Albums and targets
        -E LIST Comments and targets
        -D LIST Identifiers and targets
        -G LIST Image and targets
        -N LIST Info and targets
        -p List all entry targets in absolute paths (same as -O -l target)

        -x Preview changes (with -w)
        -f In playlist relative local target base path
        -z Ignore in playlist parse errors
        -w Out playlist file (.asx, .cue, .jspf, .m3u, .pls, .wpl, .xspf)
        -o Clobber playlist (with -w out; or first in)
        -R Out playlist local targets relative to out playlist
        -B Out playlist local targets base path
        -O Out playlist local targets in absolute paths
        -I Out playlist local targets in file URI scheme (implied -O)
        -t Set title for out playlist
        -b Set artist for out playlist
        -g Set image for out playlist
        -k Set comment for out playlist
        -c trackpos:track Move entry
        -a Insert or append target as entry
        -e track:FIELD=value Set entry field
        -r Remove entry matching track or target
        -d Remove duplicate entries from out playlist
        -u Remove unfound target entries and images from out playlist
        -j Merge nested playlists
        -n Out playlist entries in random order
        -m Minimal out playlist (targets only)
        -s Verify network targets
        -i Get entry metadata from local targets
        -q Quiet
        -v Verbose
        -h This help

FIELD can be one of: (ta)rget, (ar)tist, (ti)tle, (al)bum, (co)mment, (id)entifier, (im)age, (in)fo, album (tr)ack, (du)ration

LIST can be one of: dupe, image, net, netimg, target, unfound, unfoundimg, or unique (multiple infiles)

Exit codes:
0: Success or quiet flag
1: Out playlist has unfound entry targets or images; or multiple artists, images, or titles; or a dupe or unfound list contains at least one entry; or an in playlist was not found or was parsed with errors; or metadata could not be read from a target
2: IO, parse, or command line error
&#10140;  build git:(main) &#10007;


先贴个linux环境下编译成功的操作序列吧,windows下安装各种依赖库很麻烦,楼主是只要二进制文件?
 楼主| freckle 发表于 2025-12-12 17:23
PhiFever 发表于 2025-12-12 17:11
[mw_shl_code=bash,true]&#10140;  playlist git:(main) mkdir build && cd build
&#10140;  build git:(m ...

有个windows上能运行的程序就行
 楼主| freckle 发表于 2025-12-12 17:25
吾爱_zxl 发表于 2025-12-12 16:48
看了下。以为很简单。然后发现依赖了pugixml、RapidJSON、libcurl、TAGLIB 而且还没法直接用对应的cmake直 ...

谢谢,谢谢
吾爱_zxl 发表于 2025-12-12 18:38
PhiFever 发表于 2025-12-12 17:11
[mw_shl_code=bash,true]&#10140;  playlist git:(main) mkdir build && cd build
&#10140;  build git:(m ...

多提醒一句。window需要使用mingw或者msys去编译。msvc没法编译哦
pzx521521 发表于 2025-12-14 02:50
https://parap.lanzouq.com/iZ2hN3dkp6pi
win下代码改了好多(by cursor)
[Asm] 纯文本查看 复制代码
cmake -B build -S . ^
  -G "MinGW Makefiles" ^
  -DCMAKE_C_COMPILER=C:/w64devkit/bin/x86_64-w64-mingw32-gcc.exe ^
  -DCMAKE_CXX_COMPILER=C:/w64devkit/bin/x86_64-w64-mingw32-g++.exe ^
  -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg-tool-main/scripts/buildsystems/vcpkg.cmake ^
  -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic


[Asm] 纯文本查看 复制代码
cmake --build build


exe 位于 "\playlist-main\build\playlist.exe"
pzx521521 发表于 2025-12-14 02:55
本来作者没有做windows版的

先装依赖 对应文件 vcpkg.json

[Asm] 纯文本查看 复制代码
vcpkg install --triplet x64-mingw-dynamic


指定mingw+vcpkg,生成windows下的build文件夹
[Asm] 纯文本查看 复制代码
cmake -B build -S . ^
  -G "MinGW Makefiles" ^
  -DCMAKE_C_COMPILER=C:/w64devkit/bin/x86_64-w64-mingw32-gcc.exe ^
  -DCMAKE_CXX_COMPILER=C:/w64devkit/bin/x86_64-w64-mingw32-g++.exe ^
  -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg-tool-main/scripts/buildsystems/vcpkg.cmake ^
  -DVCPKG_TARGET_TRIPLET=x64-mingw-dynamic

改各种报错
build
[Asm] 纯文本查看 复制代码
cmake --build build
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - 52pojie.cn ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-12-25 17:36

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表