Difference between revisions of "Compiling with Microsoft Visual C++ (OpenXcom)"
Jump to navigation
Jump to search
m |
(→Issues fixed: Fix for the issue with linking precompiled yaml-cpp dll) |
||
(16 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
+ | ==Setting up== |
||
− | == Getting the source == |
||
+ | # Download [https://windows.github.com/ GitHub for Windows]. |
||
− | You will need a Windows Git client to grab the latest source code. |
||
+ | # Download the source code from [https://github.com/SupSuper/OpenXcom here], by pushing '''Clone in Desktop'''. |
||
+ | # Download and install [http://store.steampowered.com/app/7760/ X-COM: UFO Defense]. |
||
+ | # Navigate to '''<path-to-game>\XCOM\''' and copy the following folders. |
||
+ | <pre> |
||
+ | GEODATA |
||
+ | GEOGRAPH |
||
+ | ROUTES |
||
+ | MAPS |
||
+ | SOUND |
||
+ | TERRAIN |
||
+ | UFOGRAPH |
||
+ | UFOINTRO |
||
+ | UNITS |
||
+ | </pre> |
||
+ | 5. Navigate to '''<path-to-repo>\OpenXcom\bin\UFO''' and paste the folders in there. |
||
⚫ | |||
− | === TortoiseGit === |
||
+ | # Download and install Visual Studio. A free version is available [https://www.visualstudio.com/products/visual-studio-community-vs here]. |
||
+ | # Download the following dependencies for the appropriate version of Visual Studio: |
||
+ | #* [http://openxcom.org/download/dev/openxcom-deps-win-vc2010.zip 2010] |
||
+ | #* [http://openxcom.org/download/dev/openxcom-deps-win-vc2013.zip 2013] |
||
+ | #* [http://openxcom.org/download/dev/openxcom-deps-win-vc2015.zip 2015] |
||
+ | #* [http://openxcom.org/download/dev/openxcom-deps-win-vc2017.zip 2017] |
||
+ | # Extract the archive's contents to '''<path-to-repo>\OpenXcom\''' |
||
+ | #Navigate to '''<path-to-repo>\OpenXcom\src''' and open '''OpenXcom.2010.sln'''. |
||
+ | #Compile the project by right clicking on '''OpenXcom''' and selecting '''Build'''. Upgrading the project may be needed on newer versions of Visual Studio. |
||
+ | #Navigate to '''<path-to-repo>\OpenXcom\bin''' then copy all the '''DLLs''' from '''<path-to-repo>\OpenXcom\bin\Win32''' to '''<path-to-repo>\OpenXcom\bin\Win32\Release''' |
||
+ | #Move the '''common''', '''UFO''' and '''standard''' folders from '''<path-to-repo>\OpenXcom\bin''' to '''<path-to-repo>\OpenXcom\bin\Win32\Release''' |
||
+ | * Certain anti-viruses such as Avast may stop the project from building. Add the OpenXcom folder as an expection. |
||
− | # Install [http://code.google.com/p/msysgit Git for Windows]. When asked, select '''Use Git Bash only''', '''Use OpenSSH''' and '''Checkout Windows-style, commit Unix-style line endings'''. |
||
⚫ | |||
− | # Install [http://code.google.com/p/tortoisegit/ TortoiseGit]. Restart the computer if asked. |
||
− | # Configure TortoiseGit by right-clicking any folder and selecting '''TortoiseGit > Settings'''. Select '''Git > Config''', fill out your '''Username''' and '''E-mail''' as will be displayed in your commits, and make sure '''AutoCrlf''' and '''SafeCrlf''' are checked. |
||
− | # Go to the folder where you wanna put the code, right-click on it and select '''Git Clone'''. |
||
− | # Fill out the '''Url''' to the repository (the official one or your own fork), check the '''Directory''' is correct and press '''OK'''. Better get a drink, it's gonna be a while. |
||
− | # In the future, you can stay up to date by right-clicking your folder and selecting '''Git Sync''' to '''Pull''' the latest code. |
||
+ | ==Issues fixed== |
||
− | === Git Extensions === |
||
⚫ | |||
⚫ | |||
+ | ===afxres.h not found=== |
||
− | # Install [http://code.google.com/p/gitextensions/ Git Extensions] for your system. |
||
+ | Remove '''resource.h''' and '''OpenXcom.rc''' from the project. |
||
− | # TODO |
||
+ | ===MSVCR100.DLL not found=== |
||
− | == Installing dependencies == |
||
+ | Install these [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5555 files]. |
||
⚫ | |||
− | Put the required library files in a '''deps''' folder inside the codebase folder with the following structure: |
||
+ | Compile as Win32. |
||
− | * '''deps\include\SDL''' - SDL headers |
||
− | * '''deps\include\yaml-cpp''' - yaml-cpp headers |
||
− | * '''deps\lib\Win32''' - library x86 DLL and LIB files |
||
− | * '''deps\lib\x64''' - library x64 DLL and LIB files |
||
+ | ===unresolved external symbol "<blah-blah-blah> YAML <blah>"=== |
||
− | Alternatively, you can grab the [http://openxcom.org/download/dev/openxcom-deps-win-vc.zip pre-compiled dependencies] with all the files already in place, and extract it to your codebase folder. |
||
+ | Try adding <code>YAML_CPP_DLL</code> define to the project properties |
||
− | |||
⚫ | |||
− | |||
− | # Install Microsoft Visual C++ (part of Visual Studio). If you don't have it, you can get [http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express VC++ 2010 Express Edition] for free. |
||
− | # Go to the '''src''' subfolder inside your codebase folder and open '''OpenXcom.2010.sln''' if you have VC++ 2010 or '''OpenXcom.2008.sln''' if you have VC++ 2008. You might get issues using older versions, but you can try just editing the version number in '''OpenXcom.2008.sln''' and '''OpenXcom.2008.vcproj''' to match. |
||
− | # Compile and run the project by pressing the '''Start Debugging''' button with a green arrow on the top toolbar. |
||
⚫ | |||
− | |||
− | == FAQ == |
||
− | |||
⚫ | |||
⚫ | |||
− | |||
− | '''Q: I get an error about afxres.h not being found.'''<br> |
||
− | A: You're using a Visual C++ Express Edition which doesn't support Resource files, just remove '''resource.h''' and '''OpenXcom.rc''' from the project. |
||
− | |||
− | '''Q: I get an error about MSVCR100.DLL not being found.'''<br> |
||
− | A: You're using the pre-built dependencies with an old Visual C++ version so you need to install the [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=5555 VC++ 2010 Redist]. |
||
− | |||
⚫ | |||
− | A: You're using a Visual C++ Express Edition which doesn't support x64 builds, but you can still compile for Win32. |
||
[[Category:OpenXcom]] |
[[Category:OpenXcom]] |
Revision as of 21:59, 5 May 2018
Setting up
- Download GitHub for Windows.
- Download the source code from here, by pushing Clone in Desktop.
- Download and install X-COM: UFO Defense.
- Navigate to <path-to-game>\XCOM\ and copy the following folders.
GEODATA GEOGRAPH ROUTES MAPS SOUND TERRAIN UFOGRAPH UFOINTRO UNITS
5. Navigate to <path-to-repo>\OpenXcom\bin\UFO and paste the folders in there.
Compiling (x32 Release)
- Download and install Visual Studio. A free version is available here.
- Download the following dependencies for the appropriate version of Visual Studio:
- Extract the archive's contents to <path-to-repo>\OpenXcom\
- Navigate to <path-to-repo>\OpenXcom\src and open OpenXcom.2010.sln.
- Compile the project by right clicking on OpenXcom and selecting Build. Upgrading the project may be needed on newer versions of Visual Studio.
- Navigate to <path-to-repo>\OpenXcom\bin then copy all the DLLs from <path-to-repo>\OpenXcom\bin\Win32 to <path-to-repo>\OpenXcom\bin\Win32\Release
- Move the common, UFO and standard folders from <path-to-repo>\OpenXcom\bin to <path-to-repo>\OpenXcom\bin\Win32\Release
- Certain anti-viruses such as Avast may stop the project from building. Add the OpenXcom folder as an expection.
- See the Visual Studio Documentation for more information on the IDE.
Issues fixed
Failed To Load Palette
Copy the X-Com resources to your bin folder, see Installing for more details.
afxres.h not found
Remove resource.h and OpenXcom.rc from the project.
MSVCR100.DLL not found
Install these files.
Platform 'x64' cannot be found
Compile as Win32.
unresolved external symbol "<blah-blah-blah> YAML <blah>"
Try adding YAML_CPP_DLL
define to the project properties