1:
GitHub源码:
https://github.com/mpc-hc/mpc-hc
For up to date instructions on how to compile mpc-hc visit the wiki page:
https://trac.mpc-hc.org/wiki/How_to_compile_the_MPC
2:一般情况下,checkout完成后,找到mpc_hc工程中的Compilation.txt,然后按照进行配置编译就可以了;
每个版本的具体编译有些许不同,详细参考具体工程下的Compilation.txt;
注意:
1:一般情况下,工程中都会带有 bat文件,如果是xp系统一般没有问题,如果是win7系统一般需在头文件第一行添加cd /d %~dp0,如C:\MSYS\postinstall下的pi.bat文件,添加以
后才可以在win7上正常运行(很多工程或文件都有bat文件),如果有相关的就不用添加了;
2:如果Compilation.txt建议工程放到c盘,就先放到c盘,这样有利于配置,而且有利于bat文件运行(我换了其他路径bat文件就不可以运行了);
3:一般Compilation.txt中 会有安装directx和MSYS_MinGW_GCC,所以自然需要配置到你的工程中,而Compilation.txt没有讲如果配置,你可以自己上网查如何配置;
现在最新版本中你给的编译文件是:mpc-hc/docs/Compilation.md
//2017.12;
现在MPC-hc 用的是MSYS2进行编译的,具体的区别自行百度;
具体Windows上配置MSYS2的方法同理在Compilation.txt会有;
之前的工具网址:http://xhmikosr.1f0.de/
官网地址: https://mpc-hc.org/
最新的代码在: https://github.com/mpc-hc/mpc-hc
//安装make
pacman -S make
//安装git
pacman -S git
Preparing the GCC environment
-
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.
-
Install it on
C:\MSYS\
. You can always install it somewhere else, but these instructions assume the aforementioned place. -
Run
msys2_shell.bat
(if you didn't use the installer you must restart MSYS2 after first run). -
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.
-
Download YASM and save it as yasm.exe in
C:\MSYS\usr\bin
:- 32-bit: http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win32.exe
- 64-bit: http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win64.exe (Recommended)
- 注意:这里需要修改名字,取消-1.3.0-win64;
-
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) 说明:其实这里也可手动下载安装GCC:可以忽略这一步,安装上面的下载替换就可以了,下载gcc: 参考这里:
https://blog.csdn.net/qiuzhiqian1990/article/details/56671839,我们先通过命令pacman -Ss gcc查询完整的gcc包名;
pacman -S msys/gcc
pacman -S gcc
-
-
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.
这里顺便提一下另一个俄国版本的MPC-be;
具体的过程和MPC-hc差不多,但是还是用的MSYS编译,还在维护;
https://sourceforge.net/p/mpcbe/code/HEAD/tree/trunk/docs/
http://mpc-be.org/
msys2 获取windows环境变量:
之前的msys可以默认启动获取windows环境变量,但是msys2不可以默认获取windows环境变量了;
当然可以启动以后,通过export 设置临时环境变量,和cmd通过set 设置临时环境变量;
访问windows PATH环境变量
from:https://www.cnblogs.com/wswind/p/10650126.html
三种方法选择一个就可以:
- msys2_shell.cmd 中取消一行的注释:set MSYS2_PATH_TYPE=inherit
- 调用msys2_shell.cmd时使用-use-full-path参数
- 在windows系统的环境变量中添加 MSYS2_PATH_TYPE=inherit