请教下大家怎么在QT上使用taglib

qq_29531275 2017-12-17 07:54:17
我想用taglib来读取音乐标签信息,但是下载了taglib库后不知道怎么用,也下了cmake编译,但也出现了问题,弄了一天都不知道自己在干什么,是一定要编译吗?还是添加头文件直接使用就行?求会的人教教我
...全文
308 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ningto.com 2021-01-16
  • 打赏
  • 举报
回复
看INSTALL.md文档: Windows It's Windows ... Systems vary! This means you need to adjust things to suit your system, especially paths. Tested with: Microsoft Visual Studio 2010, 2015, 2017 Microsoft C++ Build Tools 2015, 2017 (standalone packages not requiring Visual Studio) Gcc by mingw-w64.sf.net v4.6.3 (Strawberry Perl 32b) MinGW32-4.8.0 Requirements: Tool chain, build environment, whatever ya want to call it ... Installed and working. CMake program. (Available at: www.cmake.org) Installed and working. Optional: Zlib library. Available in some tool chains, not all. Search the web, take your choice. Useful configuration options used with CMake (GUI and/or command line): Any of the ZLIB_ variables may be used at the command line, ZLIB_ROOT is only available on the command line. option description ZLIB_ROOT= Where to find ZLib's root directory. Assumes parent of: \include and \lib. ZLIB_INCLUDE_DIR= Where to find ZLib's Include directory. ZLIB_LIBRARY= Where to find ZLib's Library. ZLIB_SOURCE= Where to find ZLib's Source Code. Alternative to ZLIB_INCLUDE_DIR and ZLIB_LIBRARY. CMAKE_INSTALL_PREFIX= Where to install Taglib. CMAKE_BUILD_TYPE= Release, Debug, etc ... (Not available in MSVC) The easiest way is at the command prompt (Visual C++ command prompt for MSVS users – batch file and/or shortcuts are your friends). Build the Makefiles: Replace "GENERATOR" with your needs. For MSVS: Visual Studio XX YYYY, e.g. Visual Studio 14 2015. Note: As Visual Studio 2017 supports CMake, you can skip this step and open the taglib folder in VS instead. For MinGW: MinGW Makefiles C:\GitRoot\taglib> cmake -G "GENERATOR" -DCMAKE_INSTALL_PREFIX=C:\Libraries\taglib Or use the CMake GUI: Open CMake GUI. Set paths: Where is the source code and Where to build the binaries. In the example, both would be: C:\GitRoot\taglib Tick: Advanced Select: Configure Select: Generator Tick: Use default native compilers Select: Finish Wait until done. If using ZLib, Scroll down. (to the bottom of the list of options ... should go over them all) Edit: ZLIB_INCLUDE_DIR Edit: ZLIB_LIBRARY Select: Generate Build the project MSVS: C:\GitRoot\taglib> msbuild all_build.vcxproj /p:Configuration=Release OR (Depending on MSVS version or personal choice) C:\GitRoot\taglib> devenv all_build.vcxproj /build Release OR in the MSVS GUI: Open MSVS. Open taglib solution. Set build type to: Release (look in the tool bars) Hit F7 to build the solution. (project) MinGW: C:\GitRoot\taglib> gmake OR (Depending on MinGW install) C:\GitRoot\taglib> mingw32-make Install the project (Change install to uninstall to uninstall the project) MSVS: C:\GitRoot\taglib> msbuild install.vcxproj OR (Depending on MSVC version or personal choice) C:\GitRoot\taglib> devenv install.vcxproj Or in the MSVS GUI: Open project. Open Solution Explorer. Right Click: INSTALL Select: Project Only Select: Build Only INSTALL MinGW: C:\GitRoot\taglib> gmake install OR (Depending on MinGW install) C:\GitRoot\taglib> mingw32-make install To build a static library, set the following two options with CMake: -DBUILD_SHARED_LIBS=OFF -DENABLE_STATIC_RUNTIME=ON Including ENABLE_STATIC_RUNTIME=ON indicates you want TagLib built using the static runtime library, rather than the DLL form of the runtime.
Sweet hort 2021-01-15
  • 打赏
  • 举报
回复
兄弟解决了吗?

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧