Home :: Updates :: Player Screenshots :: Editor Screenshots :: Documentation

Compiling Under Windows

So it looks you want to bite the bullet and compile the project whilst on your lovely Windows box. Fantastic, but get ready for some fairly gnarly stuff. Before we go anywhere, let's get some preamble out of the way. I have compiled and tested the project using Microsoft Visual Studio 2005, and so the rest of this text is going to assume that you're using the same IDE and compiler. "But wait!" you may be exclaiming from your comfortable office chair, "You used gcc under Linux, so why not just use Dev-C++ with MinGW! You're just making things harder by using MSVC!"

Yes, it's true that MinGW is a better choice in this case, but as you will soon learn, one significant library that this project, well, just the editor specifically, uses can't be compiled under MinGW. As annoying as that is, I feel your pain. Anyway, onward!

  1. Getting Started
  2. In the Blue Corner: Dirent!
  3. Setting Up libarchive
  4. Choose Your Path



Getting Started

Before we can starting compiling either the player or editor, we need to satisfy a common dependency: GTK+ and gtkmm. The former is the GUI toolkit that the editor uses (the latter is its C++ wrapper), and the player solely uses its Unicode strings for internationalization. Both come with friendly installers, so this part of the process is literally a breeze.

Your first stop should be here. Under the "Main Category Listings," you should notice a gtk+-win32-devel list. Under it, click the most recent version (for me, it was 2.10). From there, just grab the most recent release in that series (I used gtk+-dev-2.10.11-win32-1). Once the installer has finished downloading, just follow through the setup process. Along the way, you'll be presented with a list of components to install. You should leave all of the boxes there checked, since we'll be needing everything that installer will place on your lovely hard drive. Also, the installer will offer to detect and configure the setup for any compilers it detects on your system. If MSVC is checked, make sure to uncheck it, since we'll be doing all of the necessary configuring by ourselves. For the installation path, I chose C:\GTK, but it really doesn't matter. Wrap up the installer, and move on to the next part of our adventure.

Once GTK+ is installed, let's get its companion. Head over to the FTP site here, and find the gtkmm version that corresponds to the GTK+ version. That is, if you downloaded the release I said before (gtk+-dev-2.10.11-win32-1), then you would get gtkmm-win32-devel-2.10.11-1.exe (make sure to get a -devel- release). Anyway, download the installer, and fire it up. Go through a few screens, and you should eventually come to the installation path again. Now, for the sake of absolute simplicity, you should install it where you installed GTK (that would be C:\GTK if you're following my setup). Once again, it doesn't matter where you install it to, but trust me, it's easier to have everything in one place. On the next screen, leave everything checked, and finish the installation.

That's all for the preamble, now move along to the next sections.


In the Blue Corner: Dirent!

What's this cryptic thing all about? Well, as of now, I implemented seeking through directories with this nifty library. There is a reason behind this madness: dirent is (thanks to the efforts of other people) cross-platform, which means that instead of having to mess with the Windows API functions and separating Linux/Windows code, all of my directory related needs could be accomplished with just one, tiny header file. What's the other plus? It's easy to include when compiling!

You can grab the relatively static library from here. When you extract the archive, you'll notice two folders: include and lib. As you may have guessed, copy the dirent.h from the former into your MSVC include folder. Likewise, copy the contents of the lib folder into your MSVC's counterpart lib folder. That's all.


Setting Up libarchive

As you sigh when you realize that yet another library is needed, you may be glad to know that this step is also a piece of cake. The reason libarchive may sound foreign to you, is because it actually is: this is a POSIX library to extract, you guessed it, archives! Someone actually ported this library to Windows, but in order to actually start using it, you would normally need to download all of its dependencies. After much trial and error, tweaking with the headers themselves, I think I finally got the damn thing to work.

So, in order to save you the trouble of all of the headaches that will ensue, I have put together a zip archive with all of the files you need. Get it here. Again, move the files from the extracted archive into the appropriate locations in your MSVC's corresponding folders. Like magic, you're done with this library.


Choose Your Path

From here, the documentation splits according to what you want to compile:
  1. Player
  2. Editor



Hosted on Sourceforge.net. All Phoenix Wright trademarks and other property are copyright Capcom.