Mechanized Assault & eXploration Reloaded

Howto: Building maxr on Visual Studio 2010

Building maxr on Visual Studio 2010

1. Requirements
  1. Visual C++ 2010
  2. Ankh SVN (or any other SVN tool)
  3. SDL (Development Libraries "SDL-devel-1.2.xx-VC8.zip")
  4. SDL_Mixer ("SDL_mixer-devel-1.2.xx-VC.zip")
  5. SDL_Net ("SDL_net-devel-1.2.x-VC8.zip")
2. Creating new Project

After you have downloaded and installed all files and programs you have to start Visual Studio and create a new project. Do this by selecting "File->New->Project" from the top menu. Then select the "Win32-Project", type a name for the project (e.g. maxr) and hit OK.



In the next windows you have to click on "Next" first. Then select an "Empty project" and hit "Finish". The project has been created.


3. Getting the source

Now you have to get the source from SVN. To do so you first have to make visual studio use AnkhSVN as source control plug-in. Select "Extras->Preferences" and then "Source Control->Plug In Selection". In the drop down box you have to select "AnkhSVN - Subversion Support for Visual Studio" and hit OK.



Next you have to checkout the source files. Open the Repository Explorer by selecting "View->Repository Explorer" and click on "Add a new URL to the Repository Explorer".



In the upcoming window you have to enter the SVN address of maxr:
svn://maxr.org/



Browse to the directory "MAX/trunk" and click on "Checkout from Subversion". The destination path should be the folder where the source files of the project should be located. Normally:
"C:\Users\<Username>\Documents\Visual Studio 2010\Projects\maxr\maxr"
Click on okay and wait till it has finished.



Now you have to do the same for the game data files located in "MAX/game". Select any destination folder you want to have the game in later on (I used "C:\Games\maxr" e.g.).
You have to checkout the game directory as well because there are some icons in there we need to compile the game. So copy the files "maxr.ico" and "maxr.bmp" from game directory to the directory you have checked out the sources to. (e.g. from "C:\Games\maxr" to "C:\Users\<Username>\Documents\Visual Studio 2010\Projects\maxr\maxr").
4. Setting up the project
Now you have everything you need to compile maxr. First we have to add the files to the project. Do this by clicking right on source folder in the solution explorer (the window on the left side) and select "Add->Existing Element".



Select all "*.c/*.cpp"-files in the next window and click okay. Do the same for the header folder and all "*.h"-files and for the resource folder the icons and the file "MAX.rc".
These were all files maxr needs. Now you have to set the preferences of the project. Click right on the project in the solution explorer and select "Preferences". Browse to "Configuration preferences->Linker->Input". You have to edit the "Additional Dependencies". Click on the line and select "Change". In the upcoming window you have to enter the libraries the linker should link to. maxr needs:
  • SDL.lib
  • SDLmain.lib
  • SDL_Mixer.lib
  • SDL_Net.lib

Enter them to the list and hit OK.



Now you have to make Visual Studio to know where it can find these libraries. In Visual Studio 2010 you have to open the "Preferences Manger" for this ("View->Preferences Manager"). Expand the project node and the folder Debug or Release (It makes no difference because the changes you will take are not depended on this). The click right on the node "Microsoft.Cpp.Win32.user" and select Preferences. Then browse to "General Settings->VC++-Directories". Here we have to add the include and library directories to the SDL packages. Select "Includedirectories" and "Change". In the upcoming window you have to add lines to the "include" folders located in the directories where you have unpacked SDL, SDL_Mixer and SDL_Net to. Do the same for the "Librarydirectories" and the "lib" folder of the SDL packages.



If everything was done fine you are now finished setting up your maxr build environment. You should now be able to build maxr via "Create->Create maxr".

All times are GMT +01:00. Current time: 12:48 am.