My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
CompilationGuideForWindows  
PCSX2 Compilation Guide for Windows.
Featured
Updated Dec 2, 2010 by Jake.Stine


Note: Click on the thumbnails for full-sized screenshots!

1. Setting up the Build Environment

In order to compile PCSX2 you will need to configure a working build environment based on Microsoft's Visual Studio. There are a lot of things to download, so I've placed links to them at the front of the guide so you can get everything you'll need as the first step.

Downloading the Prerequisites

You know the drill -- download all of these. You have your choice between Visual Studio 2008, Visual C++ 2008 Express and Visual Studio 2010 Professional, but at present Visual Studio 2010 is not an officially supported build environment so users are discouraged from electing to use it to compile PCSX2 (more detail provided below).

Installing Microsoft Visual Studio

At present, there are three versions of Microsoft Visual Studio that are capable of compiling PCSX2. Depending on whether or not you develop professionally, as well as other factors, you may or may not have access to a copy of Microsoft Visual Studio 2008 Standard. To ensure the widest applicable audience, this guide will cover the installation and configuration of all three of these versions. Note, however, that it is only required for you to install one of them!

Installing Microsoft Visual Studio 2008 Standard Edition

  1. Insert your Visual Studio 2008 Standard CD (or download the Trial from the link above). Run setup and click next at the Welcome Screen (shown below). It's your choice as to sending information about the setup experience to Microsoft.
  2. Accept the terms of the EULA and enter your product key.
  3. The Visual Web Developer and Visual Basic features are not required in order to compile PCSX2, however, if you program in any of these languages, you may elect to install them and it will not cause any problems. Make sure to install Visual C++. I recommend keeping the default installation paths.
  4. Visual Studio will begin installing.
  5. Once setup is complete, you will be presented with the following screen. Click Finish.
  6. Now that Visual Studio is installed, your system needs a few patches in order to be current. Visiting Windows Update with Microsoft Update enabled shows the following:
  7. Install all of the updates and then Visual Studio 2008 is ready to go. Skip the Visual C++ 2008 Express and Visual Studio 2010 Professional sections and continue below with Installing SDKs.
1 2 3 4 5 6

Installing Microsoft Visual C++ 2008 Express Edition

  1. Download the Visual C++ 2008 Express Edition Installer from the link above. Run it, and click next at the Welcome Screen (shown below).

  2. Accept the EULA. It's your choice whether or not you allow it to display online and RSS content, it doesn't make a difference to the compiling of PCSX2.
  3. You do not need Microsoft SQL Server 2008 Express Edition in order to compile PCSX2, however, if you are doing development in any other capacity that requires a local SQL Database, you may choose to install this component.
  4. I recommend keeping the default installation location. Click Next.
  5. The components will be downloaded to your computer.
  6. Once done downloading, they will then be installed.
  7. Once the installation has finished, you will see the following screen.
  8. Click Finish and the installer will close. Now that Visual C++ is installed, your system needs a few patches in order to remain current. Visiting Windows Update with Microsoft Update enabled shows the following:
  9. Download and install the updates, and then skip past Installing Visual Studio 2010 Professional and continue with the SDK installations.
1 2 3 4 5 6 7 8

Installing Microsoft Visual Studio 2010 Professional (Beta 1)

NOTE: Visual Studio 2010 is not presently a supported build environment for PCSX2. The instructions and configuration information below are provided sheerly for completeness's sake as Visual Studio 2010 will ultimately be a supported build platform, and this information will be updated as it nears completion and release. It is not recommended that you attempt to build PCSX2 with Visual Studio 2010 at this time.

  1. Download the Visual Studio 2010 Professional Web Installer from the link above. Run it, and click next at the Welcome Screen (shown below). Yes, it will have the Visual Studio Team System logo even though you downloaded Visual Studio 2010 Professional and the titlebar and actual text say so. Don't ask me. Ask Microsoft.
  2. Accept the EULA and enter your Product Key, then hit Next.
  3. The .NET Development Environment is NOT required in order to configure PCSX2, but you can choose to install it if you plan on doing .NET Development. I recommend installing Visual Studio in the default location to ensure there are no problems later on.
  4. Visual Studio's installer will begin downloading the installation components.
  5. Once it has finished downloading the components, it will begin installing them.
  6. Soon after beginning the installation, I was prompted to reboot in order to continue.
  7. After I rebooted and logged on, I got the following at system startup:
  8. The installer then launched and continued installing where it had left off.
  9. After that finishes, you should be presented with the following screen:
  10. Click finish and the installer will close. Now that Visual Studio is installed, your machine needs several more patches in order to be current. Visit Windows Update with Microsoft Update enabled and you'll be presented with the following updates
  11. The SQL Server update isn't required for PCSX2, but is recommended in general to keep your machine as up-to-date as possible. After the updates have installed, Visual Studio 2010 Professional is now installed on your computer. Go ahead on to the next step.
1 2 3 4 5 6 7 8
9 10 11

Installing SDKs

The PCSX2 codebase makes use of several freely available SDKs that must be downloaded and installed in order to successfully compile PCSX2. If you are intending to compile the PCSX2 plugins as well, you will need additional SDKs. Each of the requisite SDKs is listed below.

DirectX SDK

  1. Download the Web Installer from the link above. Run it, and click next at the Welcome Screen (shown below.)
  2. Accept the EULA as shown.
  3. You will be prompted to join the Windows Customer Experience Improvement Program. I chose not to, but the decision is yours to make. It won't impact anything you'll be doing with the software.
  4. You will then be prompted for a destination folder, I recommend choosing the default to make life easier later on.
  5. You will be prompted with a list of components. The default selection will suffice for building PCSX2, so go ahead and click Next.
  6. The DirectX SDK will then begin installing.
  7. You should then be presented with this screen.
  8. Click finish and move on to the next step.
1 2 3 4 5 6 7

OpenGL Extension Wrangler (GLEW)

Download the OpenGL Extension Wrangler binaries from the website listed above. Extract the files into a directory of your choice. In this case, I have extracted them to:
   C:\Development\Add-On Libraries\GLEW\  
Secondarily, if you intend to build and use the debug version of the gsDX plugin, you will need to manually copy glew32.dll to the \bin subdirectory of your pcsx2 installation. For example, if you followed the defaults on a 32-bit system, you'd put it here:
   C:\Program Files\pcsx2\bin

Windows 2003 R2 Platform SDK (Visual C++ 2008 Express ONLY)

  1. If you are compiling using Visual C++ 2008 Express, in order to compile several of the plugins, you will need files that are not included with your version of Visual Studio by default. Download the Windows 2003 R2 Platform SDK Web Installer from the link above, and run the installer. Click Next at the Welcome Screen shown below.
  2. Accept the EULA and click Next.
  3. Choose the Typical install when prompted and click Next.
  4. I recommend leaving the installation at the default directory to ensure there are no problems in the future.
  5. The installer will then ask you to confirm that you are installing....
  6. Then it will install.
  7. After the installation has completed, you will see the following screen. Click Finish and the installer will close.
  8. Continue to the next prerequisite.
1 2 3 4 5 6 7

nVidia's CG Toolkit

  1. Download the nVidia CG Toolkit from the link above and run the installer. Click next at the Welcome Screen as shown.
  2. Accept the EULA and click next.
  3. Accept the default installation destination and click next.
  4. The default component selection will suffice for PCSX2 compilation, however, you can add anything that is not selected if you want it and the source code examples and documentation are not required (and will shave 30-40MB off of the install).
  5. Review the confirmation screen and click Next to continue.
  6. The installer will begin the install process.
  7. You will be presented with the following screen when the installer has finished:
  8. Continue on to the next section.
1 2 3 4 5 6 7

Installing an SVN Client

An SVN client is not required in order to build PCSX2, but it is strongly recommended and is the only supported way of obtaining the current revision of PCSX2 source code. In this case, we're using TortoiseSVN

TortoiseSVN

  1. Visit the TortoiseSVN website listed above and go to the Downloads page. Download the latest version of TortoiseSVN and run the installer. You will be presented with the following Welcome screen. Click Next.
  2. Accept the EULA and click Next.
  3. The default components will suffice for the purposes of this installation. Click Next.
  4. Review the Confirmation Screen to ensure the information is correct, and click Next to begin the install process.
  5. You will see the current progress while TortoiseSVN is installing.
  6. Once complete, you will see this screen. Click Finish.
  7. You will be prompted to reboot your computer. Save your work and reboot, then continue to the next section.
1 2 3 4 5 6 7

2. Configuring the Build Environment

Configuring the SDK Library and Include Directories

Before PCSX2 will compile successfully, we need to ensure that all of the include, library, and header directories for the SDKs that we have installed are configured in our respective version of Visual Studio.

Microsoft Visual Studio 2008 Standard Edition

  1. Navigate to your C:\Development\Project Source\PCSX2\ directory and double click on the pcsx2_suite_2008.sln Solution file. This will open Visual Studio 2008 and you will be presented with a screen that should look similar (it may not look exact) to the one here:
  2. To access the configuration that we need to change, we will need to open the Tools menu and select Options from it.
  3. Expand "Projects and Solutions" from the left-hand side and then select "VC++ Directories". This will bring up the dialog that allows you to modify the search paths for your VC++ solutions.
1 2 3
  • Several changes need to be made here.
  • Under the Win32 Platform, you need to add the following to Include files:*If you installed GLEW elsewhere, reflect here
  •    $(DXSDK_DIR)\Include
       $(ProgramFiles)\NVIDIA Corporation\Cg\include
       C:\Development\Add-on Libraries\GLEW\include
  • Under the Win32 Platform, you need to add the following to Library files:*If you installed GLEW elsewhere, reflect here
  •    $(DXSDK_DIR)\Lib\x86
       $(ProgramFiles)\NVIDIA Corporation\Cg\lib
       C:\Development\Add-on Libraries\GLEW\lib
  • Under the x64 Platform, I added the following for Library files:*NVIDIA Directory only available or necessary if compiling on a 64-bit OS
  •    $(ProgramFiles)\NVIDIA Corporation\Cg\lib.x64
       $(DXSDK_DIR)\Lib\x64
  • That should finish up all of the search directory modifications required for PCSX2 to build properly. Now on to the next step!

Microsoft Visual C++ 2008 Express Edition

  • Visual C++ 2008 Express Edition has several limitations not found in either Visual Studio 2008 Standard or Visual Studio 2010 Professional. Because of this, there are special instructions specific to this build environment.
  • To begin, make all of the same changes that you would make for Visual Studio 2008 Standard, except ignore anything relating to the x64 builds and build directories, as Visual C++ Express cannot compile x64 builds. Also note that you will get error about project folders not being supported in this version of the software every time you open the .sln file. This will not interfere with your compiling, just click OK to them all.
  • In addition to the changes above, you will need to tell Visual C++ 2008 where to find the Microsoft Windows 2003 R2 Platform SDK we downloaded.
  • To access the configuration that we need to change, we will need to open the Tools menu and select Options from it.

  1. Expand "Projects and Solutions" from the left-hand side and then select "VC++ Directories". This will bring up the dialog that allows you to modify the search paths for your VC++ solutions.
1
  • Under the Win32 Platform, you need to add the following to Include files:
  •    $(ProgramFiles)\Microsoft Platform SDK for Windows Server 2003 R2\include\atl
       $(ProgramFiles)\Microsoft Platform SDK for Windows Server 2003 R2\include\mfc
  • Next up is to get around a limitation regarding the compiling 32-bit ATL / MFC solutions in the Express editions of VS.
  • Open the file C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include\atl\atlbase.h in a text editor and search for the following text:
  •    #pragma comment(lib, "atlthunk.lib")
  • Comment this out, so that it reads:
  •    // #pragma comment(lib, "atlthunk.lib")
  • Save the file and exit your text editor.
  • Once you have done this, you should be able to continue on to the next steps.

Microsoft Visual Studio (Beta 1) Professional

  • Coming soon...

3. Getting the Source Code

In order to compile PCSX2, you will need to first download all of the current source code to your local machine. Depending on which branch you are downloading, the repository locations may change.

Downloading the PCSX2 Main Trunk SVN Code

Make the Trunk Build Directory

The first thing you will need to do is make a directory that will ultimately house your SVN Source Code for PCSX2. I have chosen the following directory:
   C:\Development\Project Source\PCSX2\
You can choose whatever directory you like, just make sure that you substitute it in any location that I have included the above directory.

Configure the Trunk Directory as an SVN Directory and Download the Latest Revision

  1. Open the parent folder to your new PCSX2 directory and right click on the PCSX2 directory in the list. Since TortoiseSVN is installed, you will now see "SVN Checkout" in the drop-down list. Select it.
  2. You will be presented with an SVN Checkout configuration page, which will ask you for the "URL of Repository". Enter the following, as shown in the screenshot:
  3.    http://pcsx2.googlecode.com/svn/trunk/
  4. You will see information similar to the screenshot when the checkout is complete.
  5. You can verify the existence of the Source code by visiting the PCSX2 directory. You'll see something like the screenshot.
1 2 3 4

Download Updated Trunk Revisions

  1. After you have configured this directory as an SVN directory, all you need to do in the future is right click on it from Explorer and select "SVN Update" from the context menu as shown in the screenshot.
  2. TortoiseSVN will then fetch the latest code and show you a log of all of the files that were updated.
  • If you are interested in what changes have been made since your last source download, click the "Show Log" button.
1 2

Downloading the PCSX2 Legacy GUI Branch SVN Code

Make the Legacy Build Directory

Just like the main Trunk SVN branch, the first thing you will need to do is make a directory that will ultimately house your SVN Source Code for the Legacy GUI branch of PCSX2. I have chosen the following directory:
   C:\Development\Project Source\PCSX2-legacy\
You can choose whatever directory you like, but as before, make sure that you substitute it in any location that I have included the above directory.

Configure the Legacy Directory as an SVN Directory and Download the Latest Revision

  1. Open the parent folder to your new PCSX2-legacy directory and right click on the PCSX2-legacy directory in the list. Since TortoiseSVN is installed, you will now see "SVN Checkout" in the drop-down list. Select it.
  2. You will be presented with an SVN Checkout configuration page, which will ask you for the "URL of Repository". Enter the following as shown in the screenshot.
  3.    http://pcsx2.googlecode.com/svn/branches/legacy_gui
  4. You will see information similar to the screenshot when the checkout is complete.
1 2 3

Download Updated Legacy Revisions

  1. Downloading updates is the same as it is with any other SVN directory, but for completeness's sake, after you have configured this directory as an SVN directory, right click on it from Explorer and select "SVN Update" from the context menu as shown in the screenshot.
  2. TortoiseSVN will then fetch the latest code and show you a log of all of the files that were updated.
  • If you are interested in what changes have been made since your last source download, click the "Show Log" button.
1 2

4. Compiling PCSX2's Binary

You've now completed all of the "leg work" required in order to compile PCSX2 on your machine. Congratulations!

Compiling Trunk SVN Builds of PCSX2

  1. Open the PCSX2 SVN directory you have downloaded the source code in to (in this case, C:\Development\Project Source\PCSX2) and double-click on the pcsx2_suite_2008.sln Solution file. This will open Visual Studio 2008 (if it is not already open) and you will see a screen similar to this.
1

Build Target Selection (Developer, Debug, Release, SSE2, SSSE3, or SSE4 Builds)

  1. At the top of your screen, you will see a small drop down list which contains what is known as your "Build Target", as shown in the screenshot.
    • This menu corresponds to the build of PCSX2 that you will be compiling. SSE2, SSSE3, and SSE4 refer to CPU instruction sets and only apply to the gsDX Plugin (though they compile the full solution as well). The Release Build Target does not specify an instruction set target for the gsDX compile and will not compile gsDX. It is recommended that you choose all three (SSE2, SSSE3, and SSE4) as a build target (Release is unnecessary) if preparing a release build to ensure that all users have available versions of the plugin.
  2. Once you have selected the Build Target, it is time to build the solution. You can either select the Build Menu from the top menu, and choose Build Solution, or you can hit CTRL-SHIFT-B.
  • This is the moment of truth! If you've followed the instructions properly and configured all of the search directories for Visual Studio properly, this process should finish with 0 errors. Warnings are usually nothing to worry about, so, as long as the solution compiles with 0 errors and you have the output files, you should be good to go. Congratulations!
1 2

Compiling Legacy GUI SVN Builds of PCSX2

  1. Open the PCSX2-legacy SVN directory you have downloaded the source code in to (in this case, C:\Development\Project Source\PCSX2-legacy) and double-click on the pcsx2_suite_2008.sln Solution file. This will open Visual Studio 2008 (if it is not already open) and you will see a screen similar to the screenshot.
1

Build Target Selection (Developer, Debug, or Release Builds)

  1. At the top of your screen, you will see a small drop down list which contains what is known as your "Build Target", as shown in the screenshot.
  • This menu corresponds to the build of PCSX2 that you will be compiling. SSE2, SSSE3, and SSE4 refer to CPU instruction sets and only apply to the gsDX Plugin (though they compile the full solution as well). It is recommended that you choose all three as a build target if preparing a release build to ensure that all users have available versions of the plugin.
  • Build the branch release just like you would the main Trunk release.
1

5. Effective Build Troubleshooting Steps

So, your build failed. What now?

Even in the most perfect of circumstances, there is always the possibility that your build is going to fail for some reason or another. I've included a few things to try that should take care of almost all of the common compiling issues that users have.

If at first you don't succeed...

Re-try the build, at least once. Visual Studio is notorious for spamming errors about files being in use, access denied, or errors returned from mt.exe. If this happens to you, or frankly in pretty much any other case, make sure to retry the build at least once to ensure you have a reproducible build failure!

CL.EXE Compiling Errors w/ Visual Studio 2008 Standard

If you are using Visual Studio 2008 Standard and have followed this guide from start to finish and are experiencing build errors in relation to CL.EXE, a workaround is to put the VS2008 install disc in and to modify your installation of VS and add Visual C#. Note that you're not installing C# because any of PCSX2 is programmed in C#, you're installing C# because for some reason, the C++ install doesn't put the necessary version of CL.EXE in your build environment. I'm investigating why this is and will update the guide if I find a better way to solve the missing CL.EXE problem. I had this problem in two specific cases but I've been shown instances where it was unnecessary. As such, I pulled it from the main steps and added it as a possible workaround in case anyone else encounters it. It seems to only occur when running under a Virtual PC in Virtual PC 2007.

Clean your Dev Environment

It is good practice to clean your build environment of Visual Studio build-process temporary files and post-build remnants of the solution if you encounter errors while building. This is a quick and painless process. To begin, open the pcsx2_suite_2008.sln Solution file. Once Visual Studio has opened, select the build of PCSX2 that you are having trouble building from the Build Target dropdown (e.g., SSE2, SSSE3, SSE4, etc.) Click on the Build menu and select Clean Solution from the list. Once this has completed, run clean_msvc.cmd in the main PCSX2 SVN directory. This will clean out more unneeded data that Visual Studio leaves behind in a clean. Retry the build and see if this solves your problem.

Re-download the Source

It is possible (though very uncommon) for such drastic changes to be made to the source tree in SVN that you may have stale code or remnants of previous SVN revisions that have ended up sitting in your SVN directory. A quick and non-destructive way to test this is to create a new build directory and re-checkout the source from the SVN repository. After a full fresh checkout, attempt the build again.

Read the Logs - Trace the Errors

When all else fails, the error log and output screens can be a wealth of information. Even if you're not a developer, you can look at the error log and extrapolate what files are involved in the error you're having. Once you know that, search for the files and see if any of them are in the directories that are supposed to be configured in the search paths -- if so, go verify in your VC++ Directories setting that you have properly entered the dependency directories. Mistyping the directory names, including the wrong directory, or overlooking a directory is one of the most common causes of build failure and can be easily and quickly fixed. If that doesn't work, post about your experiences on the PCSX2 forum under the revelant topic and someone should be able to help you out.

6. Files Necessary from Build for PCSX2's Execution

PCSX2 only requires a few files in order to execute. Other files are required in order for it to function as an emulator, such as the plug-in files, but in this section I am referring only to which files are required in order for PCSX2 to execute successfully without errors.

Trunk SVN Build Files

The current Trunk SVN build requires the following files in order to execute:
 pcsx2.exe
 w32pthreads.v3.dll
 gnu_gettext.dll
If you will be using a debug build of gsDX, the following additional file is necessary and must be put into your pcsx2\bin directory:
 glew32.dll

Legacy GUI SVN Build Files

The current Legacy GUI SVN build requires the following files in order to execute:
 pcsx2.exe
 w32pthreads.dll
 gnu_gettext.dll
If you will be using a debug build of gsDX, the following additional file is necessary and must be put into your pcsx2\bin directory:
 glew32.dll

7. Miscellaneous PCSX2 Compiling Options

As with any project, the PCSX2 project has several configurable options in relation to compiling.

PCSX2 Target Build Directory

  • One of the options is a configurable post-build event that can optionally copy the .EXE file and required .DLL files into a folder of your choice. The files are copied both as their original filename (e.g., PCSX2.EXE) and also as a revision-tagged filename for easy regression testing (e.g. PCSX2-r1750.EXE) You will need to specify the PCSX2_TARGET_COPY Environment Variable.
  1. To do this, open the Run dialog (Hit the Windows key and R at the same time) and type "sysdm.cpl" (without quotes) and hit enter. You will be presented with a screen similar to the screenshot.
  2. Switch to the Advanced Tab and you will see the something similar to the screenshot.
  3. Click on the Environment Variables button at the bottom and you will see something similar to the screenshot.
  4. Click on New under the User Variables section and enter the information as shown in the screenshot.
  5. Once you have done that and click OK, you should see something like the screenshot.
  • Now, when you compile PCSX2, a build copy will be placed in the directory you specified! (Make sure it exists!) You will need to log off and log back in for this to take effect!
1 2 3 4 5

Stopping Unwanted Components from Compiling

  • If you are developing a specific project and do not want to compile the other projects every time you re-build the solution, or if you just don't want to compile a specific plug-in for some reason or another, you can easily accomplish this.
  1. Open the pcsx2_suite_2008.sln Solution file and right-click on the Project you wish not to compile. Select "Unload" from the context menu.
  2. You will now see that the project is listed as "(Unavailable)", as shown in the screenshot.
  • When you compile, this solution will be skipped. Best of all, this option is persistent, but does not write to the Solution (.sln) file, so making this change will not cause you to get warned of a Version Conflict every time you update your SVN in the future.
1 2

8. Running PCSX2 from the Visual Studio Debugger

It is possible (and quite easy) to run PCSX2 from the Visual Studio Debugger, if you feel so compelled to do so. See below for instructions on how to do it for each supported version of Visual Studio.

Visual Studio 2008 Standard + Visual C++ 2008 Express Edition

Setting PCSX2 to Run from the VS2008 Debugger

  1. Setting PCSX2 to run from the debugger is simple. Open pcsx2_suite_2008.sln Solution file. Once Visual Studio 2008 / Visual C++ 2008 has opened, right click on the PCSX2 project and select Properties. Expand Configuration Properties on the left-hand side, and select the Debugging option. Configure it to match the settings in the screenshot.
1
Once you've done this, hit OK. Once you're back to the main screen, hitting F5 will cause PCSX2 to run in the debugger.

Specifying Plugins on the PCSX2 Command Line for the VS2008 Debugger

  1. If you are debugging specific plugins, you can do so with the Command Arguments variable, and when that plugin is set as the Start-up Project, PCSX2 will know to load it regardless of the selected configuration or target types. See the following example screenshot which is used for debugging SPU2-X.
1
  • Notice that -spu $(TargetPath) is used as the parameter. This tells PCSX2 to load whichever copy of SPU2-X that was just built -- whether it be Debug, Devel, or Release. This saves a trip into the Configuration Dialog of PCSX2 to select the built plugin manually.

Visual Studio 2010 Professional

Setting PCSX2 to Run from the VS2010 Debugger

Specifying Plugins on the PCSX2 Command Line for the VS2010 Debugger


9. Packaging PCSX2 with Nullsoft Scriptable Install System

Just Because It Compiles Doesn't Mean It Works!

The steps included in this guide will pretty much guarantee that you can set up an environment in which you can compile the .NSI file included in the PCSX2 source to a .exe installer, but PLEASE NOTE THE FOLLOWING: Just because you can get it to compile without erroring does not mean that the output file will be a functional installer! Just like any other piece of code, the .NSI installer needs maintenance whenever there are changes to the file and directory structure of PCSX2. The installer is not the highest priority on the list, so it is possible that the .NSI is out of date and may be including out-dated files, or may not be including new files. It may complete compilation but net an installation that crashes every time it's run due to missing or unlinked .DLLs. With that said, it is NOT recommended that you use these installers without testing them in a sandbox / virtualized environment first to ensure that they properly install! A successful .NSI file compile does NOT equate to a truly successful installer build!

Installing the Nullsoft Scriptable Install System

  1. Download the installation package from the link above and run it. You will be presented with this Welcome Screen. Click Next.
  2. Accept the terms of the EULA.
  3. Select "Full Install", if it is not already checked.
  4. It is recommended that you keep the default installation directory, and click Next.
  5. The Nullsoft Scriptable Install System will install very quickly and present you with the final screenshot.
  • Click Finish and the installer will close.
1 2 3 4 5
Lastly, you need to copy the vc_redistx86.exe that you downloaded from the prerequisites above into the following directory:
 C:\Development\Project Source\PCSX2\NSIS\
If you skip this step, the NSIS compile will fail. This file must be present for any branch of PCSX2 as well, including wxGUI.

Packaging PCSX2 with NULL Plugins

  1. After you install NSIS and .NSI files are associated with the Nullsoft Scriptable Installer System, you can Right-Click on .NSI files and select "Compile NSIS Script", as shown in the picture.
  • This will compile a PCSX2 installer and include all of the null plugins. This will NOT include the additional plugins (gsDX, SPU-X, etc.)
1

Packaging PCSX2 with all Plugins

In order to compile PCSX2 and include the Plugins, you must specify the INC_PLUGINS variable to makensis.exe. To do this, run the following in a command prompt (assuming default installation directories):
 "C:\Program Files\NSIS\makensis.exe" "C:\Development\Project Source\PCSX2\NSIS\pcsx2_installer_script.nsi" /DINC_PLUGINS
This will compile PCSX2 and include all of the plugins in the installer file.

Packaging the PCSX2 wxGUI Branch

Due to a few changes in the versioning (and some not yet up-to-date code), you will need to make some changes to the pcsx2_installer_script.nsi in order to get a working installer for the wxGUI trunk. Update to the latest SVN revision and check the .NSI file at (or around) line 103. You may see the following:
    SetOutPath $INSTDIR
    File /oname=pcsx2-r${SVNREV}.exe
    ..\bin\pcsx2.exe
    File ..\bin\w32pthreads.dll
    File ..\bin\gnu_gettext.dll
Note that it is referencing w32pthreads.dll even though the wxGUI branch of PCSX2 uses an updated w32pthreads.v2.dll. Change the code to read
    SetOutPath $INSTDIR
    File /oname=pcsx2-r${SVNREV}.exe
    ..\bin\pcsx2.exe
    File ..\bin\w32pthreads.v2.dll
    File ..\bin\gnu_gettext.dll
and close the file. Note that updating the SVN after you make this change may alert you that your copy and the copy on the server do not match. This means that the NSI file has changed in the repository and you should re-download it. If you update and get an error from NSIS about being unable to find w32pthreads.dll, you'll know what to do to fix it. Once that is done, follow the same process as is outlined above for the PCSX2 Trunk SVN.

Comment by Ilya.Veselov, Sep 6, 2009

Why the c# dependency? It's not needed to compile pcsx2 at all.

Comment by project member my.n1ckn...@gmail.com, Sep 7, 2009

In my case, installing C++ by itself for some reason didn't install CL.EXE -- this could have been a localized problem with my installation, and I haven't had a chance to recreate the situation from scratch -- I added it as a precautionary measure. I'll re-test in the near future on another clean VM and see if it's truly necessary. It shouldn't be, since PCSX2 has absolutely no C# code, but since I needed it I figured I'd add it in.

Comment by project member my.n1ckn...@gmail.com, Sep 7, 2009

A reinstall in test confirms that just installing Visual V++ doesn't install the needed version of the cl.exe -- you get 64 bit releases but not the x86 version necessary. If you add the x86_amd64 directory that contains cl.exe to your search paths, the solution will still fail to compile with a similar error, still in relation to cl.exe. If anyone knows of a more elegant solution to this than installing C#, please let me know and I'll update the guide.

Comment by project member my.n1ckn...@gmail.com, Sep 7, 2009

Visual C++, too. I've never heard of Visual V++. :P

Comment by gdt1978@gmail.com, Sep 8, 2009

How can I set up directories in VS2010?

Comment by Supe...@gmail.com, Sep 8, 2009

Using VS2008 Professional 90-day trial download from Microsoft site. In languages, Only install C++, not install C# at all. I can build all things successfully, no errors occurred to interrupt.

For VS2010: Team System is not necessary, Professional Edition suffices for compilation of PCSX2.

Note that PCSX2_TARGET_COPY won't work for VS2010.

You don't need include "$(ProgramFiles?)\NVIDIA Corporation\Cg\bin" as Executable files, I can compile all of PCSX2 without it.

Comment by Supe...@gmail.com, Sep 8, 2009

set up VC++ Directories in VS2010.

You can find the VC++ Directories in your project properties. Directories are now "per-project".

Comment by project member my.n1ckn...@gmail.com, Sep 8, 2009

Good info, I'm curious as to why in two separate installs from my VS2008 STD disk it didn't copy the CL.EXE I needed. I'll give it some more testing.

There's more work that needs to be done in relation to VS2010 than just the project directories -- some of the plugins don't function properly when compiled under 2010 yet even though they may complete compilation -- that's one of the reasons I hadn't included the steps in the process yet. Though, PCSX2 compiles with no problems -- so if you're working on PCSX2 directly and don't care about the plugins, set up the per-project directories as recommended. I'll be updating the guide with this information in the somewhat near future after a few other changes have been made and VS2010 becomes a more palatable environment to compile PCSX2 in.

Good call on the not needing "$(ProgramFiles?)\NVIDIA Corporation\Cg\bin", I just tested and you're 100% correct -- it's extraneous. I'll pull it out from the next revision when I update the section about C#.

Comment by Supe...@gmail.com, Sep 8, 2009

PCSX2_TARGET_COPY

You don't need to specify this variable under System variables, only in User variables is sufficient.

Comment by project member my.n1ckn...@gmail.com, Sep 14, 2009

Looks like the "Error spawning CL.exe" issue only occurs when installing Visual Studio 2008 from a VS2008 Standard CD using the main installer. If you download the trial or install from any other edition CD, the proper version CL.exe is copied. I'll keep it where it is in the guide since it does still seem to be extenuating circumstances.

Comment by Supe...@gmail.com, Sep 20, 2009

http://code.google.com/p/pcsx2/wiki/CompilationGuideForWindows#Microsoft_Visual_Studio_2010_Professional_%28Beta_1%29

1 Download the Visual Studio 2010 Professional Web Installer from the link above. Run it, and click next at the Welcome Screen (shown below). Yes, it will have the Visual Studio Team System logo even though you downloaded Visual Studio 2010 Professional and the titlebar and actual text say so. Don't ask me. Ask Microsoft.

2 Accept the EULA and enter your Product Key, then hit Next.

I didn't get it, why don't you suggest download the iso, substituted for the web installer?

http://www.microsoft.com/downloads/details.aspx?familyid=3296BB4F-D8BA-4CFD-AA95-A424C5913F6B&displaylang=en

I used the iso for installation, the product key columns are automatically inputted and displayed gray you can't change it. Just click next to continue the installation process.

Comment by aliasgha...@gmail.com, Sep 25, 2009

I have problem by Download Of Svn I when Try To Download Show Diaglog Authentication To me

http://tinypic.com/r/21kh0mb/4

I have't User And Pass Can You of User And Pass ?

Link Diag Authentication is Above

Comment by project member pcsx2gu...@gmail.com, Sep 28, 2009

Did you even read the guide? You use this url for trunk: http://pcsx2.googlecode.com/svn/trunk/ or this for the old GUI (recommended for now): http://pcsx2.googlecode.com/svn/branches/legacy_gui

Comment by Supe...@gmail.com, Sep 29, 2009

Did you use the web installer to install VS2008 90 day trial and get it to the most up-to-date?

Because VS2008 90 day trial can install VS2008 SP1 from ISO, and then the version number is "9.0.30729.1 SP"

I dunno if the original web installer could get it or beyond.

Even VS2008 SP1 has a web installer though.

VS2008 SP1 from ISO http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61

VS2008 SP1 from web installer http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=fbee1648-7106-44a7-9649-6d9f6d58056e

Comment by Supe...@gmail.com, Oct 29, 2009

Give you a small guide to Visual Studio 2010 Professional Beta 2

http://forums.pcsx2.net/thread-11179-post-84894.html#pid84894

Comment by Supe...@gmail.com, Nov 3, 2009

This line can be removed: Visual C++ 2008 SP1 Redistributable Only needed if you're compiling the Installer

I bet Visual C++ 2008 SP1 Redistributable will be automatically installed with Visual Studio(VC++ 2008 express, VS2008 Professional, VS2010 Professional beta 2).

Besides, I didn't find a web installer for VS2008 Professional 90-day trial, that gotta install by ISO.

Comment by project member my.n1ckn...@gmail.com, Nov 9, 2009

The installer has to be placed in the same directory so it can be included with the compiled installation executable as a PCSX2 dependency when installing on a windows system without it previously installed -- it's not listed above so that you download and install it, because as you said it's installed by any of the Visual Studios -- but you need to have the actual redistributable installer file itself in the directory as the .nsis file as mentioned in the guide if you want to compile the installer.

Comment by aliasgha...@gmail.com, Jan 6, 2010

Have Pcsx2 Other Link Svn ?

Comment by bibijies...@gmail.com, Jan 19, 2010

Please show how to set as a compilation of PCSX2 newVif. Thanks you!

Comment by thegriml...@gmail.com, Apr 3, 2010

Since some progress on the OGL plugin recently, I can't compile it anymore. Always having 15 errors, all OGL related. What do I need to compile OGL correctly? :/

Comment by taltam...@gmail.com, Apr 5, 2010

I found something interesting. Instead of DirectX SDK (August 2009) I installed DirectX SDK (February 2010). I figured, newer is better, right?

well I got some failures to compile. specifically I got

Rebuild All: 32 succeeded, 1 failed, 0 skipped

I just installed DirectX SDK (August 2009) and checked the "install symbols" box (which is off by default) and now it successfully compiles with:

Rebuild All: 33 succeeded, 0 failed, 0 skipped

I don't know if it is the "DX symbols" option or if the feb 2010 is missing something that was in the august 2009 version, but either way this solved the problem.

Comment by taltam...@gmail.com, Apr 5, 2010

building 2815 I get a main exe that says it is version 0.9.7.2814 (SVN) building 2814 I get a main exe that says it is version 0.9.7.2813 (SVN)

Comment by thegriml...@gmail.com, Apr 5, 2010

I somehow managed to build it with no errors but I got bunch of warnings, and now there are more files than I need. To be more specific, beside the usual .dll's of the plugins, I have an .exp, .lib and .pdb files for each of the plugin along them. What are those?! :|

Comment by taltam...@gmail.com, Apr 5, 2010

those are intermediary files created during compilation. You can ignore them.

If you built it in C:\dev\PCSX2 and you installed it in C:\Games\PCSX2 1. Go to C:\Games\PCSX2\Plugins and delete everything in there

2. Go to C:\dev\PCSX2\Bin and copy the exe file and the dll file from there to C:\Games\PCSX2 overwriting when prompted

3. Go into C:\dev\PCSX2\Bin\Plugins and copy all the dll files to C:\Games\PCSX2\Plugins

Comment by sasuketa...@gmail.com, Apr 5, 2010

Error 128 error C1083: Cannot open include file: 'Resources/Dualshock.h': No such file or directory C:\Development\Project Source\PCSX2\pcsx2\gui\Dialogs\AboutBoxDialog?.cpp 23 1 pcsx2

Error 127 error C1083: Cannot open include file: 'Resources/ButtonIcon_Camera?.h': No such file or directory C:\Development\Project Source\PCSX2\pcsx2\gui\Dialogs\BaseConfigurationDialog?.cpp 25 1 pcsx2

Error 129 error C1083: Cannot open include file: 'Resources/BackgroundLogo?.h': No such file or directory C:\Development\Project Source\PCSX2\pcsx2\gui\AppRes?.cpp 23 1 pcsx2

i get this error, how do i fix it?

Comment by thegriml...@gmail.com, Apr 6, 2010

@ taltamirh - thanx for the advice. You mean just to use the dll's and exe's and to copy them to where the emulator is, and ignore other files? I was thinking of the same thing, as it is the most sane solution. Though, what the heck are those other files and why am I getting them? Never happened before...

Comment by taltam...@gmail.com, Apr 6, 2010

yes that is exactly what I mean.

the other files are intermediary files created by the compiler as part of its work. AFAIK they were always there. I don't know why it bothers you they are there... they are used in the creation of the dll and exe files, you only need the dll and exe files to run the program once compiled.

Comment by taltam...@gmail.com, Apr 12, 2010

I found that DX symbols is not related to the install problems.

On a "virgin" with visual studio pro 2008: 1. Installing DX SDK feb 2010 will cause compilation errors. 2. Installing DX SDK aug 2009 will compile correctly. 3. Installing DX SDK aug 2009, then UNINSTALLING DX SDK aug 2009 and installing DX SDK feb 2010 will compile correctly. (uninstalling both will fail to compile miserably).

Bottom line is, install DX SDK aug 2009 at some point in time, even if you later upgrade to feb 2010

Comment by sasuketa...@gmail.com, Apr 14, 2010

@taltamirh

installing dx sdk 2010 is fine as well aug 2009, i dont know what your going to prove

Comment by taltam...@gmail.com, May 30, 2010

@ sasuketaichou This is only an issue for people who have never installed a DX SDK (since their last windows reinstall).

Comment by project member Jake.Stine, Jun 1, 2010

@taltamirh: I'm running two machines which have had only Feb 2010 installed on them. They both worked fine without error. I never installed Aug 2010 on them (I hadn't used either machine prior to late March 2010, in fact).

Whatever was causing an error, it wasn't Feb 2010 specifically. It was probably some corrupted install, or perhaps the installer failed to set some of the dirs properly. without a more detailed list of the actual errors the compiler gave, there's no sure way to know.

Comment by Norikumi...@gmail.com, Jun 25, 2010

Latest Visual Studio 2008 + DirectX SDK give me these errors while building xpad:

1>.\xpad.cpp(646) : error C3861: 'XInputEnable': identifier not found 1>.\xpad.cpp(674) : error C3861: 'XInputEnable': identifier not found

And it fails to build. XInput.h is from 5/14/2010 so I guess being outdated is not the issue.

Comment by danileon95@gmail.com, Aug 19, 2010

When I open the sln, in visual c++ 2008 express, it says that "plugins", 3rdpary" any many other things are "not avaiable". What the hell? Any help?

Comment by project member shadowladyngemu@gmail.com, Aug 26, 2010

It says the "solution folders" are not available, it will not change much or anything at all when you compile.

Comment by tonyalfaro512@gmail.com, Jan 9, 2011

I have the same problem (NorikumiSubs?)

error C3861: 'XInputEnable', I think it should happen that I use the latest DirectX SDK... but I have not checked yet

Comment by MADevil....@gmail.com, Mar 7, 2011

For the XInputEnable crash . move up lib and include from DXSDK up in the list or remove lib and include of Windows SDK from the list of VC++ Directories

Comment by cassiori...@gmail.com, Aug 11, 2011

This article should be updated.


Sign in to add a comment
Powered by Google Project Hosting