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

Compiling the Editor Under Windows

Before you take the big step into compiling this bloated piece of junk, make sure you didn't get excited and forget to install those GTK+ packages I mentioned in the preamble of the previous page. Yes, as much as it hurts to download that 15 MB installer, you'll have to do it now. Assuming you're set, feel free to move along.
Table of Contents

  1. Fun With ImageMagick
  2. Setting Up MSVC

Fun With ImageMagick

Remember how I said that because of one, certain dependency I was forced to use MSVC? Well, this is it. As it seems, trying to get this library to work with MinGW is a royal pain, and so, at least now, I'll just stick to MSVC. It's not that big of a deal anyway. ;)

Anyway, ImageMagick is used by the editor to read individual frames from a GIF file, to flatten images that have transparency, and to assemble sprites from a collection of GIFs. Sounds useful, right?

From this page, grab the latest Windows release. You may notice that there are several files, but you should download the recommended one right above that table of available releases. For me, it was ImageMagick-6.3.8-7-Q16-windows-dll.exe. Download the installer, and once again, start it up. Follow through as usual (it doesn't matter where you install it to), but you'll eventually reach a screen with available components. Make sure to check the box next to "Install development headers and libraries for C/C++."

Then, finish up the installation. You're now done with ImageMagick.

Setting Up MSVC

Believe it or not, you should have all of the necessary dependencies now, at least for the editor. Now we need to sort out include paths so your compiler won't drown you in errors. First and foremost, we need to figure out GTK's mess of includes, since that makes up at least 90% of the editor's code. Ok, maybe not 90%, but you get the idea. However, there is good news! We don't actually have to do any manual work whatsoever, since there is a spiffy tool that will take care of all of that nasty includes work for us.

First, we need to do one, small configuration step. We need to add an environment variable to your system, so right click on My Computer, go to Properties, open the Advanced tab, and click the Environment Variables button on the bottom. In the System Variables frame, click New. In the dialog that just popped up, type in PKG_CONFIG_PATH for Variable Name. Now, assuming you installed GTK to C:\GTK, type in C:\GTK\lib\pkgconfig for the Variable Value field. Click OK and exit out of the dialogs.
You now need to open up a command prompt window, and change into where you installed GTK, and then into the bin folder there. Once there, execute this command without the quotes:
"pkg-config.exe gtkmm-2.4 --cflags"

If everything went right, pkg-config will spit a bunch of paths. You should copy those (right click, Mark, select the text, Enter), and paste them into a blank Notepad document. The paths will be broken down into a few lines, so make sure everything is on one line in your Notepad. Now, replace all of those forward slashes with backward slashes (protip: Edit -> Replace *gasp*), and you should have a list of include paths. Make your compiler aware of them.

Usually, with includes come libraries that the linker needs. Luckily, pkg-config has all the answers. Repeat what you did above, except now, instead of running that other command, try this one: "pkg-config gtkmm-2.4 --libs"

Once again, copy and paste that output into Notepad, and tidy it up. The output should contain many -lxxx bits. What you should do is to take each -lxxx, remove the prefix (-l), and add a .lib extension to the end. So, let's say we have: -lgtkmm-2.4. You would change that to: gtkmm-2.4.lib. Why all this extra effort? This is because pkg-config assumes you're using gcc (which takes linker libraries in that format), but since we're using MSVC, we need to be careful to pass the right arguments.

If you're wondering, this is what my linker dependencies looked like:


Hurray, almost there! Now you just need to add the remaining libraries:


With this, the compiler should now have everything it needs. The only piece of the puzzle is to add a preprocessor define. Since we're compiling on Windows, certain code needs to be included in the build. This is done by defining __WIN32__.

So, without further ado, you can finally start compiling the editor! If all goes well, you'll end up with an executable... which won't work initially. You need to throw in the dat.dpkg file (found in the CVS repository) first, since the editor can't function without the necessary resources in that file. Also, there exists a textbox.png image file (once again, also in CVS) which needs to be in the same folder as the editor. Secondly, you probably will be missing a few DLLs. They all can be found on your system, most likely in the MSVC\bin folder, so it's only a matter of just copying them.

When you have done everything up to this point, your newly compiled editor should now work. Of course, it's likely that I missed something in this walkthrough, and if I did, please email me so I can correct it for future reference. Additionally, you may run into trouble somewhere along the build process. If that's the case, I'll gladly try and help you out. Honestly, the editor is the harder of the two components of this project to compile, so any tech support is on the house. :)

That's all for now. Good luck, and happy compiling!

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