HowTo Setup a build environment under windows using Visual Studio 2008
In these instructions I do assume you have at least some limited experience with Visual Studio; this is not ment as a Visual Studio tutorial.
Download the necessary tools
- Visual C++ 2008 Express Edition is the free, downloadable version of Visual C++. Download this if you do not own a copy of one of the paid editions.
- MsysGit is a fork of git for windows. Download the first file in the list.
- 7-Zip (or a compatible extractor) is an open source file archiver with a high compression ratio.
- wxPack is a precompiled version of wxWidgets so that you don't have to compile it yourself. It also comes with wxFormBuilder.
- Boost consulting has a precompiled version of boost; it is only necessary to download this if you wish to build SpringLobby with libtorrent (integrated content downloading) support.
Installation & configuration
The programs doesn't requires special installation instructions, unless specifically mentioned in this guide.
wxPack
The Visual Studio project files are preconfigured with the default installation path "C:\Sourcecode\Libraries\wxWidgets2.8", so it is preferred to not change this. If you change it anyway, or you get a newer version, then remember where you installed it as you will need to change the path in the project files later.
Boost
The Visual Studio project files are preconfigured with the default installation path "C:\Program Files\boost\boost_1_35_0\", so again it is preferred to not change this. If you change it anyway, or you get a newer version, then remember where you installed it as you will need to change the path in the project files later.
Git
Open up the command prompt (start -> run -> type in cmd -> press ok). Go to the directory where you want the SpringLobby source to be downloaded to. (e.g. C:/ if you want it in C:/springlobby). Find out who's git repository you want to download from (You can find a list of the repositories here.).
Now type:
git-clone git://springlobby.info/git/buildbot/springlobby.git
Change the URL with the URL of the Repository you are downloading from.
Line endings
One issue with Git on Windows is it's crappy support for multiple types of line endings. At the time of this writing, msysgit comes with the setting core.autocrlf = true. This means that all textual stuff coming out of the repository is converted to CRLF, and all textual stuff going into it is converted to LF.
This, however, proves a problem in case any CRLF line is in the repository, because in this case a clean checkout will seem modified to git, blocking almost all functionality (many things aren't allowed in unclean working tree).
I found that the following setting, contrary to the msysgit default, works best for me:
git config -f .git/config core.autocrlf input
This way this setting only applies to the current repository, and not to all your other git repositories. It's effect is that you get all files checked out as they are in the repository, ie. usually with LF line endings. Because any decent tool does not choke on different line endings, this usually isn't a problem, and because git converts stuff to LF on commit, you don't risk messing up the repository either (by putting more CRLF line endings in it.)
Compiling the project
- Launch Visual Studio.
- Open the SpringLobby solution (.sln) file.
- Choose the desired configuration. In particular, do NOT choose "Debug with libtorrent" or "Release with libtorrent" if you did not install boost in the first step. If you choose any of the "Debug" configurations, you may need to get MSVCP71D.DLL and MSVCR71D.DLL (debug C runtime, needed by wxWidgets DLLs) later on, to run SpringLobby.
- If you did not install boost, you may need to unload the libtorrent project from the solution.
- If you installed wxPack or boost in a non-standard location, you may need to go to the libtorrent & SpringLobby project property pages, and adjust the "Additional Include Directories" and "Additional Library Directories" fields.
- Press F7 to compile.
- Wait patiently until the compile finished. (Grab coffee.)
- Copy the DLLs from "C:\Sourcecode\Libraries\wxWidgets2.8\lib\vc_dll" to the output directory. ("bin/Debug", "bin/Release", whatever you picked earlier.)
- Press F5 to run.
Next time you can just use F5 / F7 to compile/run, you only need to do all the other steps once of course.
Troubleshooting
If you get linker errors about symbols not being found, it may be that the Visual Studio project file isn't entirely up to date. Try to determine in which file the symbols are defined, add this to the project and try the build again.
If you encounter troubles with any of the steps, please check the guide again and if doesn't help, contact the lobby developers.
