wiki:Build/Windows

Building on Windows

This page contains instructions on how to compile Aegisub by yourself for the Windows operating system.

Note that there are important differences depending on whether you want to build a 2.1.x branch version or the development trunk version.

This is a fairly complex process, but required if you plan to stay ahead of SVN snapshots or contribute to the project by sending patches.

For obtaining the source code, see Developer/SubVersion.


Compilation environment

  • Microsoft Visual C++ 2008 Professional or higher edition: Recommended environment.
  • Microsoft Visual C++ 2008 Express or Standard editions: May require additional set-up of the environment, not recommended.
  • Microsoft Visual C++ 2005, 2003, 2002 .NET: Not supported. The 2005 version might work, but has been known to miscompile Lua.
  • Microsoft Visual C++ 2010: Untested, the changes to the project and build system (MSBuild) probably means you will need to make new project files for yourself.
  • Intel C++ compiler for Visual Studio: Might work, has been knows to work at one point in time. Unsupported.
  • Any other C++ compiler will not work, this includes MinGW/GCC. Aegisub assumes a Microsoft-compiler when built on Windows.

If you intend to build FFmpegSource2 yourself you will also need a MinGW environment, this is not described on this page.


Dependencies

These are dependencies you will need to download separately. Dependencies included in the Aegisub source tree are not listed here.

  • DirectX SDK to build the DirectSound audio players (recommended)
    • This may not be required if you use the Windows 7 SDK.
  • OpenAL SDK to build the OpenAL audio player
  • PortAudio v18 or v19 for the PortAudio player
  • PulseAudio for the PulseAudio player (untested on Windows)
  • DirectShow Baseclasses from the Windows SDK built, to build with the DirectShow video provider (only in 2.1.x branches, untested and unsupported)

wxWidgets

wxWidgets version required:

  • Aegisub 2.1.x for Windows requires wxWidgets 2.8.10
  • Building Aegisub trunk requires a wxWidgets 2.9 version

Guidelines for building wxWidgets in an Aegisub-supported configuration:

  • Unicode version of wxWidgets. Aegisub does not support building in ANSI/codepage mode. (Please let Windows 9x die.)
  • Disable all backwards compatibility options, such as WXWIN_COMPATIBILITY_2_6 in the 2.8 versions of wxWidgets.
  • wxUSE_STACKWALKER=1 if you want Aegisub to generate crash logs.
  • wxUSE_STL=0, we have previously had crashes in Aegisub with this enabled.
  • wxUSE_GLCANVAS=1, the video display code cannot compile without this.
  • STC (StyledTextControl) must be built separately in wxWidgets 2.8, Aegisub's subtitles edit control requires this.

For building wxWidgets 2.8.10 in a supported configuration, attached to this page is build-aegisub-wx28.cmd, a Windows command file that with only a little configuration will automatically build and install wxWidgets to a configured location. You may need to edit the file if you do not have a compiler for 64 bit installed.

A command file for building wxWidgets 2.9 might also be provided later.

Making wxWidgets available to the Aegisub build:

The command file provided above already creates the file layout described here.

  1. Decide where you want the root of your Aegisub build to be. This will usually be where you checked out the source code. This is where you will later create the Visual Studio solution file for building Aegisub.
  2. Create a folder named wxlib in this location.
  3. Under the wxlib folder create these folders:
    • include: From the wxWidgets source tree, copy these files: png.h pngconf.h zconf.h zlib.h
      • wx: Copy the entire include folder from the wxWidgets source tree to here.
        • stc: For wxWidgets 2.8, copy the contrib\include\wx\stc\ folder to here.
    • lib32: Copy all built 32 bit .lib files to here.
    • lib64: Copy all build 64 bit .lib files to here, if you have built 64 bit libraries.

DirectSound

  • Ensure the DirectX SDK include and library directories are in the VC++ include and library paths. The DirectX SDK installer program should set this up for you.

FreeType 2

  • Ensure you have built the debug and release static library builds of the DLL Multithreaded runtime version. The MSVC project files distributed with Freetype names these built libraries as freetype237.lib and freetype237_D.lib for release and debug versions.
  • Add the include and library directories of your FT2 build to the VC++ paths

Similar for other libraries. Make sure you use versions built for the Multithreaded DLL runtimes, and add their include and library directories.


Building Aegisub

This assumes you're using Visual Studio 2008. If you're using a different version, you're on your own.

  1. Decide where you want to build Aegisub at, this determines where the produced binaries and intermediate files will be placed, and where the project files will look for dependencies.
  2. In Visual Studio, ensure you do not have any projects or solutions open. Select File, New, Project. Find the Blank Solution project type under Other Project Types, Visual Studio Solutions. Name the Solution and pick a temporary location to store it at. We will move it soon.
  3. Because creating a Solution implies also creating a new folder for it, you might not want the solution to be named the same as the folder containing it. You can close the still-blank solution in Visual Studio, move the .sln file somewhere else, and open it again.
  4. Add the following two projects to the solutions:
    • aegisub/build/aegisub_vs2008/aegisub_vs2008.vcproj
    • aegisub/universalchardet/universalcharset_2008.vcproj
  5. Optionally add the following projects to the solution, depending on what you want to build:
    • contrib/csri/csri_2008.vcproj (for dynamic loading of CSRI subtitle renderers, but see below about VSFilter)
    • contrib/hunspell/src/win_api/libhunspell_2008.vcproj (for spellchecking support)
    • contrib/lua51/lua51_vc9.vcproj (for Automation 4 Lua support)
    • aegisub/src/libauto3/auto3_vc9.vcproj (for Automation 3 support)
    • contrib/lua50/lua50_vc9.vcproj (for Automation 3 support)
  6. Create a new project named libs or similar, the project must be a blank Win32 static library project. Remove all the pre-added files and folders in the project. Add external .lib files required by Aegisub to this project, such as the Freetype libraries and optionally a .lib file for a VSFilter version with CSRI. If you add VSFilter like this, you must not use the csri_2008.vcproj project in your solution. Set the properties for the individual .lib files added to the project so they are excluded from the build in all but the configurations they are wanted. Attached to this page is an example of such a "libs" project.
  7. Set project dependencies in the solution: The main Aegisub project depends on everything except the lua50_vc9 project, if you have that. The auto3_vc9 project depends on the lua50_vc9 project.
  8. Copy aegisub/src/config/config_windows0.h to config_windows.h in the same directory, and edit it to configure your build.

You should now be able to hit Build on the Aegisub project and get an executable produced.

Last modified 3 years ago Last modified on 02/16/2010 04:38:30 AM

Attachments (3)

Download all attachments as: .zip