VS2015编译MPC-HC源码

已经验证下面的方法可以编译通过,如果觉得麻烦,可以直接下载我已经编译通过的代码,程序编译完成以后,需要将一些依赖的库文件(用MPC-HC的安装包安装完成以后,可以从里面获取依赖文件)拷贝到编译目录下面。拷贝完依赖库以后就可以启动播放器了。

MPC-HC源代码下载(已经编译通过)

1.编译 mpc-hc.sln

2.编译mpciconlib.sln

3编译mpcresources.sln

4.拷贝依赖库到编译目录

Compilation instructions

General Tools

First of all, install Git for Windows from https://git-for-windows.github.io/. Choose Use Git from the Windows command prompt. This isn't mandatory, so if you choose Use Git from Git Bash only make sure you set the MPCHC_GIT variable in build.user.bat.

Part A: Preparing the Visual Studio environment

Visual Studio 2017 or 2015

  1. Install Visual C++, part of Visual Studio (any edition will work fine). Make sure to select Windows 8.1 SDK and MFC and ATL support during installation.
  2. Make sure you have installed all available updates from Microsoft Update
  3. Install the DirectX SDK (June 2010) → https://go.microsoft.com/fwlink/?LinkID=71193

Part B: Preparing the GCC environment

  1. Download MSYS2 from http://www.msys2.org/. If you are on a 64-bit Operating System, which you should be, get the 64-bit version.

  2. Install it on C:\MSYS\. You can always install it somewhere else, but these instructions assume the aforementioned place.

  3. Run msys2_shell.bat (if you didn't use the installer you must restart MSYS2 after first run).

  4. Install the needed software by running these commands:

    pacman -Syu
    pacman -Su
    pacman -S make pkg-config
    

    Note that this is the bare minimum, you can install more packages that can be useful to you.

  5. Download YASM and save it as yasm.exe in C:\MSYS\usr\bin:

  6. Download and extract MinGW to C:\MSYS\mingw\ from http://files.1f0.de/mingw/ (you might use the one that ships with MSYS2, but we recommend this one)

  7. Create a file named build.user.bat in C:\mpc-hc\ containing the following entries, adapted for your system:

    @ECHO OFF
    SET "MSYSTEM=MINGW32"
    SET "MPCHC_MSYS=C:\MSYS"
    SET "MPCHC_MINGW32=%MPCHC_MSYS%\mingw"
    SET "MPCHC_MINGW64=%MPCHC_MINGW32%"
    REM You can set `MSYS2_PATH_TYPE` here or in environment variables so that Git is properly added to your `PATH`
    REM SET "MSYS2_PATH_TYPE=inherit"
    REM `MPCHC_GIT` is optional to set if you chose to add it in `PATH` when installing it and have set `MSYS2_PATH_TYPE`
    SET "MPCHC_GIT=C:\Program Files\Git"
    REM Optional, if you plan to modify the translations, install Python 2.7 or set the variable to its path
    SET "MPCHC_PYTHON=C:\Python27"
    REM Optional, If you want to customize the Windows SDK version used, set the variable
    SET "MPCHC_WINSDK_VER=8.1"

NOTES

  • For Visual Studio 2017, we will try to detect the VS installation path automatically. If that fails you need to specify the installation path yourself. For example:
    SET "MPCHC_VS_PATH=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\"
  • If you installed the MSYS/MinGW package in another directory you will have to use that path in the previous steps.
  • If you don't have Git installed then the revision number will be a hard-coded one, like 1.6.3.0.

Part C: Downloading and compiling the MPC-HC source

  1. Use Git to clone MPC-HC's repository to C:\mpc-hc (or anywhere else you like).

    1. Download Git from https://git-for-windows.github.io/

    2. Run:

      git clone --recursive https://github.com/mpc-hc/mpc-hc.git
      

      or

      git clone https://github.com/mpc-hc/mpc-hc.git
      git submodule update --init --recursive
      

      If a submodule update fails, try running:

      git submodule foreach --recursive git fetch --tags
      

      then run the update again

      git submodule update --init --recursive
      

      Note that you can add -b master to the git clone command if you want to get the latest stable version instead of the latest development version

  2. Open the solution file C:\mpc-hc\mpc-hc.sln. Change the solution's configuration to Release (in the toolbar).

  3. Press F7 to build the solution.

  4. You now have mpc-hc.exe under C:\mpc-hc\bin\mpc-hc_x86

  5. Open the solution file C:\mpc-hc\mpciconlib.sln

  6. Press F7 to build the solution.

  7. You now have mpciconlib.dll under C:\mpc-hc\bin\mpc-hc_x86

  8. Open the solution file C:\mpc-hc\mpcresources.sln

  9. Build BuildAll project.

  10. You now have mpcresources.XX.dll under C:\mpc-hc\bin\mpc-hc_x86\Lang

Alternatively, you can use build.bat that can build everything for you (run: build.bat help for more info)

Part D: Building the installer

Download Inno Setup Unicode v5.5.9 or newer from http://www.jrsoftware.org/isdl.php. Install everything and then go to C:\mpc-hc\distrib, open mpc-hc_setup.iss with Inno Setup, read the first comments in the script and compile it.

NOTES

  • build.bat can build the installer by using the installer or the packages switch.
  • Use Inno Setup's built-in IDE if you want to edit the iss file and don't change its encoding since it can break easily.
### MPC-HC 用户手册与操作指南 MPC-HC(Media Player Classic - Home Cinema)是一款高效、轻量级的多媒体播放器,支持多种音频和视频格式。为了帮助用户更好地掌握其功能并充分利用该软件,官方及相关社区提供了详细的文档和支持资源。 #### 官方支持与文档 MPC-HC 的开发团队在其官方网站上提供了一个名为 **Trac** 的平台用于技术支持和问题解答[^1]。虽然 Trac 并不直接托管完整的用户手册,但它包含了大量关于常见问题和技术细节的信息。如果需要深入学习 MPC-HC 的具体配置或解决特定问题,可以通过访问以下链接获取更多指导: - 支持页面: [https://trac.mpc-hc.org/](https://trac.mpc-hc.org/) 此外,MPC-HC源码仓库也公开在多个平台上,其中包括一些技术说明文件和构建指南[^2]。尽管这些资料可能更偏向于开发者视角,但对于希望深入了解播放器内部机制的用户来说仍然非常有价值。 #### 使用指南与教程文章 除了官方渠道外,还有许多第三方网站撰写了有关 MPC-HC 的使用技巧和高级设置的文章。例如,在一篇详细介绍如何通过扩展插件增强 MPC-HC 功能的文章中提到,利用 Lua 脚本可以实现高度个性化的用户体验[^3]。这类内容通常会附带实际案例分析以及截图演示,非常适合初学者快速入门。 对于那些想要自己动手尝试修改程序参数甚至重新编译的人士而言,则需参照专门针对不同版本 MinGW 编译环境设定路径调整的相关指引[^4]: ```bash # 设置附加库目录 (以 Mingw GCC 4.5.0 X86为例) set ADDITIONAL_LIBRARIES=../../../../lib;$(MINGW32)/lib/gcc/i686-pc-mingw32/4.5.0;$(MINGW32)/i686-pc-mingw32/lib/ ``` 以上命令展示了当采用特定编译工具链时应如何指定依赖项位置以便顺利完成整个过程。 #### 总结建议 目前并没有单独成册的标准版"MPC-HC User Manual",但综合运用上述提及的各种在线资源完全可以满足日常应用需求。推荐先浏览一下 trac 上面已有的问答记录来熟悉基本概念;然后再结合网络上的各类专题教学逐步探索进阶玩法!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值