Difference between revisions of "Windows"

From Apache OpenOffice Wiki
Jump to: navigation, search
(ooo-build with Visual C++ 2005 Express)
(ooo-build with Visual C++ 2005 Express)
Line 84: Line 84:
 
* [http://prdownloads.sourceforge.net/nsis/nsis-2.21-setup.exe NSIS]
 
* [http://prdownloads.sourceforge.net/nsis/nsis-2.21-setup.exe NSIS]
  
* [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/NT45/EN-US/InstMsiW.exe instmsiw.exe] and
+
* [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/NT45/EN-US/InstMsiW.exe instmsiw.exe] and [http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe instmsia.exe] - put them in the $SRCDIR/external/msi directory
[http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe instmsia.exe] - put them in the $SRCDIR/external/msi directory
+
  
 
nice [http://tools.openoffice.org/servlets/ReadMsg?listName=dev&msgNo=6031 hints]
 
nice [http://tools.openoffice.org/servlets/ReadMsg?listName=dev&msgNo=6031 hints]

Revision as of 20:32, 10 November 2006

Welcome to OOo development for Windows

This is an initial attempt to fill out information for building on Windows. If it ends up being complete, this notice can be removed! At the moment you'll have to piece together information from other pages with the changes here for doing it on Windows.

Most of this wiki assumes that you'll be using a reasonably current Linux system, as a time saving feature. While real hackers prefer Free software, if you're forced to build stuff for Windows, this is the place to be.

Development Tools

There have been several different ways of building with more or less success...

The reference page to look at is Building under Windows with tcsh. If you are going to use the ooo-build method, you should stop reading that page after the Cygwin section. The ooo-build build system will download the rest of the dependencies.

Other ways to build are documented below, the official way requires Visual C++ .NET 2003

Visual C++ .NET 2003 Professional

This is the full version of Visual C++. It is the official way to build OpenOffice.org.

Visual C++ .NET 2003 Standard (approx $109 price)

NB: These fixes have been rolled into more recent milestones, so you should now be able to happily build using standard. This is a tag to remove these notes and the page at some future point. --KaiB 13:14, 1 June 2006 (CEST)

You can use the Standard version of Visual Studio to build OpenOffice but there are certain workarounds needed. The problem is that OO.o enables /O flags in Professional that conveniently cripples the compiler enough to hide some ugly hacks and bugs that have crept in over the years. Standard does not support optimizations so suddenly these beasts get out in the open. See BuildingMSVCStandard

For how to tune the MS IDE into coding OOo efficiently, see this page.

Visual C++ Toolkit 2003

Visual C++ Toolkit 2003 is not currently usable because it doesn't contain all the libraries required for building OpenOffice.org. See Issue 51145 for progress on this issue.

TODO: fill in all the required libraries, and possible alternatives - in the issue.

Visual C++ Express 2005

Visual C++ Express 2005 the FREE microsoft compiler is now supported for windows builds. So, the great news is its possible to build openoffice with a free microsoft tool-chain. see steps for using this compiler in the Windows#Using ooo-build section below. In fact I would guess the config options below will probably work for a vanilla openoffice build also ( maybe someone will try that and add any extra info/steps here )

MinGW

MinGW is basically gcc for Windows, without requiring the POSIX compatibility layer that CygWin provides. You can use the CygWin compiler with the -mno-cygwin switch and it has the same effect.

MinGW is not officially supported at the moment, so it will probably take some work to get it

Work to build OpenOffice.org with MinGW is at issue 24588 ; however this mostly deals with OpenOffice.org 1.1 branch at the moment.

Using vanilla source

While ooo-build has been developed to make building OOo less painful, you might also try to start out with the standard source code. After you download and unpack a vanilla ooo source tarball, running "configure" in the directory "config_office" will gladly complain about missing build-dependencies. The remaining build process is described in the document Building under Windows with tcsh

Using ooo-build

These are addenda to using ooo-build with the following command line:

 ./configure --with-win32

ooo-build should pick up all the other requirements for you automatically (reading them out of the registry)

Extra requirements

  • Cygwin requires the cabextract package.

ooo-build with Visual C++ 2005 Express

The following steps were performed on a clean machine ( Win XP ) with no dev tools installed on it.

first revies the information above

bits you need and where to get them ( as of Mon 6-Nov-2006 )

  • apache-ant-1.6.5 ( afaik this actually isn't needed for ooo-build but I autopiloted it in the configure, wont do any harm )

nice hints hints from Volker re. the config flags

Note: in the configure flags shown below DirectX is disabled ( sorry at this point I was still waiting for it to download )

You need to copy msvcp80.dll and msvcr80.dll into your $SRCDIR/external/msvcp80 dir in my case I found those libraries in

/cygdrive/c/WINDOWS/WinSxS/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd/msvc

had to downgrade the gnu make version from 3.81 to 3.80 ( apparently for building mozilla, but mozilla build failed anyway for me, I haven't had time yet to investigate further )

perform the manual header change as described

Here's my configure as an example

 ./configure --disable-mozilla --with-use-shell=bash --disable-activex --with-win32 --with-distro=NovellWin32
--with-tag=src680-m190 --with-cl-home="/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC"
--with-csc-path="/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727" --with-midl-path="/cygdrive/c/Program 
Files/Microsoft Platform SDK for Windows Server 2003 R2/Bin" --with-frame-home="/cygdrive/c/Program 
Files/Microsoft Platform SDK for Windows Server 2003 R2" --with-ant-home=/cygdrive/c/apache-ant-1.6.5 
--with-jdk-home=/cygdrive/c/j2sdk1.4.2_13 --disable-directx --with-nsis-path="/cygdrive/c/Program Files/NSIS"

compile problems:

  • mozilla doesn't build, just use the mozilla binary dist.
  • lpsolve & scsolver didn't build ( these 2 are only relevant for only ooo-build with --with-distro-Novellxxxxx ) lpsolve has a minor problem with includes, in scsolver there are many template errors which I didn't investigate yet.

To disable temporarily either remove the CalcSolver label from the NovellWin32xxx sections in ooo-build/patches/src680/apply file or just use the generic PlainWin32 distro-target ( should work though I haven't tried that )

I got alot of problems with calls to remove where the call to remove inculudes std namespace. It seems that there is a precendent somewhere and maybe this at one time was known issue I opened this issue for that

I seem to get lots of "/usr/bin/bash: Resource temporarily unavailable" with my version of cygwin

$ uname -a
CYGWIN_NT-5.1 trouble2 1.5.21(0.156/4/2) 2006-07-30 14:21 i686 Cygwin 

the following steps seemed to help or maybe the problem just went away by itself :-(

  • reboot machine
  • switch to tcsh e.g. do a 'tcsh' at the command prompt
  • build from (the source tree)/instsetoo_native directory using the build --all command while in that directory

--Npower 11:42, 10 November 2006 (CET)

Miscellaneous info

  • csc.exe comes from the c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 directory, you might need --with-csc-path.
  • Beware of using /c/ instead of /cygdrive/c/.
  • Avoid trailing slashes in configure parameters. They sure cause problems for --with-psdk-home.
  • Using the latest cygwin releases (1.5.18/1.5.19) can lead to tcsh freezing in places - the build will appear to hang. You can fix this by running ls /proc/$nnn/fd where $nnn is the number of the process. Or just run
     ls /proc/*/fd
    

    to "unhang" the process. See issue 51560 for more info...

    Noone so far created a reproducible hang that doesn't require the whole OOo environment, and to make it worse, there are those who cannot reproduce the hang at all ( Works fine here ;) (User:Vq) ). Until someone provides a recipe to reproduce this problem with a small testcase we have to hope that the cygwin developers accidentally fix this problem.

  • With cygwin 1.5.18, makecab.exe hangs when run from the build process (but it works fine when run standalone). So you definitely want to use a snapshot and avoid cygwin 1.5.18, unless you enjoy wasting half a week of your life debugging like I did ...
  • With later Cygwin versions (various 1.5.19 and 1.5.20 snapshots) hangs have been noticed at least by me (User:TorLillqvist) at various stages of the build on a hyperthreading (Pentium 4) machine, while doing the same build using the exact same Cygwin version on a single-processor machine worked fine. So it might be a good idea to turn off hyperthreading.
  • If you get errors like "too long line in ddf file" during the MSI installer build this is caused by too long filenames. Try setting your TEMP/TMP environment variable to something short like "C:\tmp". There is a 255 char line limit for dds files and class names like "InvalidAuthenticationMechanismException" push the envelope. Shaving of 10-15 chars puts us back just under the limit.
  • Avoid using winzip to extract the downloaded source archive. Observed problems include:
    • CR-LF errors that can affect makefiles and cause compile errors
    • Certain files unpacked into root folder, esp. likely when actual path is deeply nested (e.g. foo/bar/source/foo/java/org/x/y/z/w/LongFileName.hmm) which again causes mysterious compile errors.
    Use the tar from Cygwin instead:
     tar xvzf OOo_2.0.2_src.tar.gz
    
  • If you fail to getting together a working installation of Cygwin, one possibility is to use a known-to-work combination of Cygwin packages, i.e. a direct copy of some other user's Cygwin tree. User:TorLillqvist has such a tree zipped up, please ask if you want to try that.

See also

Personal tools