Building on Windows

From Apache OpenOffice Wiki
Jump to: navigation, search

Template:Documentation/Building Guide AOO TOC


For general information on how to build Apache OpenOffice from source code, see the platform independent page.

Template:Documentation/Windows For building Apache OpenOffice the Cygwin environment is required. Cygwin is a set of programs that run on Windows but emulate a complete Unix command line environment.

As compiler we use Microsoft's Visual C++ 2008, not the gcc from Cygwin. Therefore Visual Studio Express/Professional (version 2008 or later) can be used for debugging.

To use this document you should be familiar with a bourne command line interpreter (sh or bash), but you need not be a UNIX shell wizard. Template:Documentation/Tip

Build requirements

Additionally to the general build requirements you need

What Where to get How to install
Windows 7 (recommended), Windows Vista, Windows XP
Cygwin, 32bit version, minimum version: 1.5.10, preferred: current version]

See below for setting up cygwin and the required packages.

Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1

It brings the Visual Studio 2008 C++ compiler with it.

This is either a DVD image or a net installer. You can either mount the DVD with a suitable tool, burn it do a DVD or use tools like winrar or 7zip to extract files from the ISO file directly. You don't need to install samples or documentation (saves a lot of disk space). It will also install the .NET Framework 3.5 SDK. It might be best to install the Windows SDK into the default directory, and if not that into one without capital letters in the path.

Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) vcredist_x86.exe, download found here

It is just packed as it is into the installation package.

The exact download URL may have changed. In that case you have to search Microsoft's website.

Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) vcredist_x64.exe, download found here

It is just packed as it is into the installation package.

The exact download URL may have changed. In that case you have to search Microsoft's website.

GDI+ Redistributable Genuine Windows Validation required. main/external/gdiplus
Runtime libraries 10.0 msvcp100.dll and msvcr100.dll for Java 7 support - see issue 120979.

Get them from the Microsoft Visual C++ 2010 Redistributable Package (x86) from the Microsoft site -


The exact download URL may have changed. In that case you have to search Microsoft's website.

Search for it on your PC or on the web. E.g., it is part of the Windows Driver Kit.

Windows Driver Kit Version 7.1.0

To enable ATL and ActiveX in the build - it is optional

related configure options are: --with-atl-include, --with-atl-lib-dir, --with-mfc-include-dir, --with-mfc-lib-dir

Microsoft DirectX SDK

To enable DirectX in the build - it is optional

related configure option is: --with-directx-home

Unicode NSIS, version 2.46.5

If Unicode NSIS is available, a self contained Windows installer is created in addition to the MSI installer files - it is optional

When building Apache OpenOffice 3.4.x or 4.0.x you need to provide some additional binaries:

Runtime libraries 7.1 msvcr71.dll for Mozilla libraries. Search for them on the web or on your PC. These files should be named as all lower case. Sometimes when downloaded they are upper case and this will cause 'file not found' errors towards the end of the build)) main/external/msvcp71
Runtime libraries 8.0 msvcp80.dll and msvcr80.dll for Mozilla libraries. Search for them on the web or on your PC. main/external/msvcp80



Setting up Cygwin

Go to and download and install the current 32bit version.

Documentation caution.png Make sure that you keep the filetype set to “Unix/binary”.
Documentation caution.png Make sure that the PATH variable in your cygwin shell does not contain any unquoted blanks and quotes, otherwise configure will not work

Additional packages for Cygwin to serve the AOO build

Cygwin consists of some basic and a lot of optional packages. As building AOO needs some of these optional packages you have to select them in the installer. Here's a complete list of the required packages:

  • Category Archive:
    • unzip
    • zip
  • Category Devel :
    • autoconf
    • bison
    • flex
    • gcc-g++
    • gperf
    • make
    • patch
    • readline
    • subversion (if you want to use svn inside the cygwin shell to checkout and update your working copy of AOO)
  • Category Net
    • openssh
    • openssl
  • Category Perl
  • Category Shells
    • mintty
  • Category Utils
    • gnupg
  • Category Web
    • wget


Breaking links to executable

Within the Cygwin Toolkit, some executables might be symlinks: awk.exe and gunzip.exe, tar.exe (in older releases only). This can lead to a break of the build later, and the symlinks should be replaced by copies of the command they link to.

To check this, execute:

ls -l /bin/awk.exe

whether e.g. awk.exe is a symlink. In version 1.5.24-2 awk.exe is a link to gawk.exe. The shell will show this by putting out “awk.exe -> gawk.exe”. In this case gawk.exe must be copied to awk.exe by executing:

cd /bin
rm awk.exe
cp gawk.exe awk.exe

In case you overlook something here or you have a newer Cygwin version with additional symlinks not mentioned here it's not a problem. You will get a helpful error message about an existing link in the configuration step (configure) later. The message will tell you which link you have to remove and you can do it following the advice given above for the awk.exe/gawk.exe pair.

Installing additional perl modules in cygwin

As explained some perl modules must be installed with CPAN. The necessary command in the cygwin shell is

perl -MCPAN -e shell

If this command is executed the first time CPAN will ask for configuration. Choose autoconfiguration.

Documentation caution.png Please note that CPAN is not able to deal with usernames containing spaces. To work around this fact, when CPAN asks you to specify the CPAN build and cache directory, change the default suggestion to /cpan.

At the end the CPAN shell appeared and is ready to accept commands for installations. Each module is installed by typing install $MODULENAME. The modules that must be installed are:

  • Archive::Zip
  • LWP::UserAgent
  • XML::Parser (though it seems that this is already installed; doesn't hurt to do it)

CPAN will detect if a selected module depends on other modules and it will offer to download them also. As explained please just confirm this.

Documentation caution.png I got an error message from CPAN somewhat like the following:
C:\cygwin\bin\perl.exe: *** unable to remap C:\cygwin\bin\cygiconv-2.dll to same
address as parent(0x7C0000) != 0x7D0000

To fix this, I had to exit the Cygwin shell, run cmd.exe, then type "c:\cygwin\bin\ash.exe" to start the minimal shell, then type /bin/rebaseall. Then CPAN worked when I ran it again.

Configure switches (Windows specific)

Additionally to the general configure switches there are several that only have to be used on Windows or have Windows specific values.

Typical values for the compiler and SDK. If default installation paths are used these configure switches are not needed:

 --with-frame-home="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.0"
 --with-psdk-home="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.0"
 --with-midl-path="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.0/Bin"

For DirectX:

 --with-directx-home="C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)"

For ATL and ActiveX:


And some more:

Personal tools