PCSX2 Documentation/Compiling on Windows: Difference between revisions
PCSX2 Documentation/Compiling on Windows (view source)
Revision as of 16:08, 19 September 2022
, 19 September 2022no edit summary
(Remove dx sdk info, no longer needed.) |
No edit summary |
||
Line 4: | Line 4: | ||
===Downloading the Prerequisites=== | ===Downloading the Prerequisites=== | ||
====Downloading build environment==== | ====Downloading build environment==== | ||
First you have to download a build environment. Microsoft Visual Studio 2019 and 2017 are capable of compiling PCSX2. At this time, the recommended build environment is Visual Studio 2019 Community. | First you have to download a build environment. Microsoft Visual Studio 2022, 2019 and 2017 are capable of compiling PCSX2. At this time, the recommended build environment is Visual Studio 2019 Community. | ||
*[https://visualstudio.microsoft.com/downloads/ Visual Studio | *[https://visualstudio.microsoft.com/downloads/ Visual Studio 2022 - Various Editions] | ||
====Downloading additional prerequisites==== | ====Downloading additional prerequisites==== | ||
*[https://git-scm.com/downloads Git For Windows] also called Git bash or msysgit (''Recommended but not required - though you will need a Git client'') | *[https://git-scm.com/downloads Git For Windows] also called Git bash or msysgit (''Recommended but not required - though you will need a Git client'') | ||
A Visual C++ redistributable runtime matching the build environment major release (''Only needed if you're compiling the Installer''): | A Visual C++ redistributable runtime matching the build environment major release (''Only needed if you're compiling the Installer''): | ||
*[https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Visual C++ Redistributable Packages for Visual Studio 2019 and 2017] | *[https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Visual C++ Redistributable Packages for Visual Studio 2022, 2019 and 2017] | ||
===Installing Microsoft Visual Studio=== | ===Installing Microsoft Visual Studio=== | ||
Microsoft Visual Studio 2019 and 2017 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 Professional. This guide will cover the installation and configuration of Visual Studio 2019 Community Windows Desktop. | Microsoft Visual Studio 2022, 2019 and 2017 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 Professional. This guide will cover the installation and configuration of Visual Studio 2019 Community Windows Desktop. | ||
====Installing Visual Studio Community | ====Installing Visual Studio Community 2022==== | ||
Download Visual Studio Community | Download Visual Studio Community 2022 installer from the link above, and run it. | ||
#Run the installer. | #Run the installer. | ||
Line 27: | Line 25: | ||
#Once the installation has finished, you may be prompted to restart the system. | #Once the installation has finished, you may be prompted to restart the system. | ||
#Click Restart Now or Close depending on your situation. | #Click Restart Now or Close depending on your situation. | ||
==Getting the Source Code== | ==Getting the Source Code== | ||
Line 63: | Line 58: | ||
====Build Target Selection==== | ====Build Target Selection==== | ||
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. | 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. | This menu corresponds to the build of PCSX2 that you will be compiling. SSE4, AVX2 refer to CPU instruction sets. | ||
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 use the appropriate shortcut key. | 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 use the appropriate shortcut key. | ||
This is the moment of truth! If you've followed the instructions 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! | This is the moment of truth! If you've followed the instructions 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! | ||
Line 72: | Line 67: | ||
If at first you don't succeed, retry 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! | If at first you don't succeed, retry 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! | ||
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.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. | 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.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., SSE4, AVX2) Click on the Build menu and select Clean Solution from the list. Try to build again, and see if this solves your problem. | ||
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 relevant topic and someone should be able to help you out. | 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 relevant topic and someone should be able to help you out. | ||
==Running PCSX2 from the Visual Studio Debugger== | ==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 all supported version of Visual Studio. | 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 all supported version of Visual Studio. | ||
Select build target from top, just like you would do to build PCSX2, then press F5 | Select build target from top, just like you would do to build PCSX2, then press F5. | ||
{{PCSX2 Documentation Navbox}} | {{PCSX2 Documentation Navbox}} |