This guide describes how we suggest to compile MPC-HC. No one is forced to do everything this way, but don't complain if something doesn't build/work otherwise.
How to compile Media Player Classic - Home Cinema
Part A: Preparing the Visual Studio environment
Visual Studio 2015
- Install Visual C++ 2015, part of Visual Studio 2015 (any edition will work fine)
- Make sure you install all available updates from Microsoft Update
- Install the DirectX SDK (June 2010) -> https://go.microsoft.com/fwlink/?LinkID=71193
Part B: Preparing the GCC environment
- NOTES:
- If you installed the MSYS/MinGW package in an other directory you will have to use that path in the following steps.
- If you don't have Git installed then the revision number will be a hard-coded one, like 1.7.10.
- Download and extract MSYS_MinGW-w64_GCC_630_x86-x64.7z to
C:\MSYS\
.
For the components and their version see here. - OPTIONAL Edit the "fstab" file in
C:\MSYS\etc\
to specify your MinGW path.C:\MSYS\mingw \mingw
Note the tab-space between mingw and \mingw
- Create a file named "build.user.bat" in "C:\mpc-hc" containing the following entries, adapted for your system:
@ECHO OFF SET "MPCHC_MSYS=C:\MSYS" SET "MPCHC_MINGW32=%MPCHC_MSYS%\mingw" SET "MPCHC_MINGW64=%MPCHC_MINGW32%" REM Git is optional to set if you chose to add it in PATH when installing it 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"
Part C: Downloading and compiling the MPC-HC source
- Use Git to clone MPC-HC's repository to
C:\mpc-hc
(or anywhere else you like)
Download Git from https://git-for-windows.github.io/
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 thegit clone
command if you want to get the latest stable version instead of the latest development version
- Open the solution file
C:\mpc-hc\mpc-hc.sln
Change the solution's configuration to "Release" (in the toolbar). - Press F7 to build the solution.
- You now have mpc-hc.exe under
C:\mpc-hc\bin\mpc-hc_x86
- Open the solution file
C:\mpc-hc\mpciconlib.sln
- Press F7 to build the solution.
- You now have mpciconlib.dll under
C:\mpc-hc\bin\mpc-hc_x86
- Open the solution file
C:\mpc-hc\mpcresources.sln
Build "BuildAll" project - You now have mpcresources.XX.dll under
C:\mpc-hc\bin\mpc-hc_x86\Lang
Alternatively, you can use build.bat
which 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.
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 theinstaller
or thepackages
switch.- Use Inno Setup's built-in IDE if you want to edit the iss file.