Part A: Preparing the Visual Studio environment.1. Install Visual C++ 2008, part of the Visual Studio package downloadable here: 
URL: http://msdn.microsoft.com/en-us/evalcenter/bb633753.aspx). 
Note: Express edition won't work (it's missing MFC, which MPC-HC uses). 
2. Install Service Pack 1 (SP1) for Visual Studio 2008 and all the Visual Studio updates via Windows Update (>300MB). 
URL: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=fbee1648-7106-44a7-9649-6d9f6d58056e 
3. Install Visual Studio 2008 Service Pack 1 ATL Security Update (Comes with Windows Update) 
URL: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=294de390-3c94-49fb-a014-9a38580e64cb 
4. Install DirectX SDK (June 2010). 
URL: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba 
When you install the DirectX SDK, a new DXSDK_DIR environment variable is added. As of r1893, you do not need to add any DirectX SDK Include/Lib directories in your Visual Studio settings. 
5. Install Windows SDK v7.1 and use its configuration tool to make it the default SDK. 
URL: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20 
Note: This version has a known bug regarding registering itself as the default SDK (on specific systems):
See here: http://blogs.msdn.com/windowssdk/archive/2009/08/21/windows-sdk-configuration-tool-may-report-an-error-when-os-display-format-is-not-english.aspx 
Part B: Preparing the GCC environment.1. Download and extract MSYS_MinGW_GCC_444_x86-x64.7z to C:\MSYS\ 
URL: http://xhmikosr.1f0.de/tools/MSYS_MinGW_GCC_444_x86-x64.7z 
For the components and their version see here 
2. Edit the "fstab" file in C:\MSYS\etc\ to specify your mingw path 
Add this to it: C:\MSYS\mingw \mingw (*note the tab-space between mingw and \mingw) 
3. Add the following environment variables (in System Properties->Advanced->Environment Variables): 
VariableValue CCgcc MSYSC:\MSYS MINGW32C:\MSYS\mingw MINGW64C:\MSYS\mingw Modify the "Path" environment variable by adding at the end: ;%MINGW32%\bin;%MSYS%\bin 
* Optional, if you wish to use the cutting edge GCC branch you can instead follow these steps: 
  1. Delete everything in this folder: C:\MSYS\mingw\ 
  2. Download and extract the new MinGW GCC version into C:\MSYS\mingw\ 
    URL: http://www.xvidvideo.ru/component/docman/cat_view/28-cross-mingwgcc-x86x64.html 
Part C: Downloading and compiling the MPC-HC source.1. Use a subversion client to checkout mpc-hc's trunk to C:\mpc-hc (or anywhere else you like) 
Repository URL: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk 
The recommended svn client is TortoiseSVN 
2. When using TortoiseSVN 
a) Create an empty directory where you want to store the source files. e.g: C:\mpc-hc 
b) Right-click on that directory and choose "SVN checkout".
c) Put https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk in "URL of Repository" and press OK.
d) Wait for the source tree to be downloaded. 
3. Open the solution file C:\mpc-hc\mpc-hc.sln 
Change the solution's configuration to "Release Unicode" (in the toolbar). 
4. Right click the MPCVideoDec project, and open up its Properties. 
There, go to Configuration Properties->Librarian->General. Change the "Additional Library Directories" to: 
For Win32 platform$(OutDir);$(SolutionDir)lib;$(MINGW32)\lib\gcc\i686-pc-mingw32\4.4.4;$(MINGW32)\i686-pc-mingw32\lib\ For x64 platform$(OutDir);$(SolutionDir)lib64;$(MINGW64)\lib\gcc\x86_64-w64-mingw32\4.4.4;$(MINGW64)\x86_64-w64-mingw32\lib\ Another way to do it, is by copying the needed mingw libs into the root\lib and root\lib64 folders. 
Note: If you update your GCC, make sure you change the version number in the above paths, e.g. 4.5.1. 
5. Press OK to save the changes and close the Properties window. 
6. Press F7 to build the solution. 
7. You now have mpc-hc.exe under C:\mpc-hc\bin\mpc-hc_x86. 
8. Open the solution file C:\mpc-hc\mpciconlib.sln 
9. Press F7 to build the solution. 
10. You now have mpciconlib.dll under C:\mpc-hc\bin\mpc-hc_x86. 
11. Open the solution file C:\mpc-hc\mpcresources.sln 
In Visual Studio go to Build->Batch Build->Press Select All->Press Build 
13. You now have mpcresources.XX.dll under C:\mpc-hc\bin\mpc-hc_x86. 
Part D: (optional) Building the installer.Download Inno Setup Quick Start Pack Unicode v5.3.10 or newer.
Install everything and then go to C:\mpc-hc\distrib, open mpc-hc_setup.iss with Inno Setup or ISTool and compile it. 
Part E: Building ffmpeg x64 (libavcodec) with GCCWhen building ffmpeg (project libavcodec_gcc)in 32 bit mode GCC is used and according to the makefile that is automatically invoked from the solution. Doing so for 64 bit, requires some additional steps (in accordance with this post by Spec-Chum): 
  1. Run MSYS and cd to the trunk\src\filters\transform\MPCVideoDec\ffmpeg_x64 folder 
Example: 
 cd /h/mpchc/trunk/src/filters/transform/MPCVideoDec/ffmpeg_x64/
(notice that the first part will most probably differ for the exact paths) 
  1. checkout the mingw files by running:  $ ./buildffmpeg.sh --updatemingw
  2. run the buildmingwlibs.sh script, only to compile:  ./buildmingwlibs.sh --compilemingw
Or 
./buildmingwlibs.sh --updatemingw --compilemingw
After the compilation is done, libgcc.a and libmingwex.a will be placed in trunk\lib64 
Now libavcodec can be compiled from within the mpc-hc visual studio solution file, and it will be linked correctly with the other components. 
Attachments
  • !components.txt (1.7 KB) - added by xhmikosr 3 weeks ago.
  • posted on 2010-08-04 12:41  一个人的天空@  阅读(1380)  评论(0编辑  收藏  举报