Compiling Mozilla With Mingw

  • Revision slug: Compiling_Mozilla_With_Mingw
  • Revision title: Compiling Mozilla With Mingw
  • Revision id: 66415
  • Created:
  • Creator: bbondy@mozilla.com
  • Is current revision? No
  • Comment 47 words added

Revision Content

{{ Note("This page used to be linked from Windows Build Prerequisites and should be again.") }}

This article explains how to use Mingw to build Mozilla projects on Windows without using Microsoft Visual Studio, in 14 steps. The versions built using these instructions are debug builds.

Disk space requirements

You will need at least 3.7 GB of free disk space in order to download the source code and install the needed build tools, as well as to build the software.

Create the main directory

All the tools and code will be located in <tt>C:\mozilla\</tt>, so create this directory first. From a command prompt, issue the command:

mkdir C:\mozilla\

Get the GNU tools for Microsoft Windows (Cygwin)

Download the Cygwin tools for Windows. This is a special version of the GNU tools that runs on Windows:

Install the tools into C:\mozilla\cygwin\. Remember to choose Unix as the Default Text File Type.

Image:Cygwin04.png

In addition to the default modules, you need to install:

  • cvs (Devel)
  • cygutils (Utils)
  • make (Devel)
  • patch (Utils)
  • patchutils (Devel)
  • perl (Perl)
  • unzip (Archive)
  • zip (Archive)

To select these optional installs, press the View button in the Select Packages part of the installer.

Image:Cygwin08.png

The following needed modules should be part of the default install, but you may wish to confirm that they're selected:

  • ash
  • diffutils
  • fileutils
  • findutils
  • gawk
  • grep
  • sed
  • sh-utils
  • textutils

Only make 3.81 is available through the cygwin installer but will not work for building mozilla sources.  Instead you need to manually replace C:\mozilla\cygwin\bin\make with version 3.80.  You can grab it from this go-mono download.

Get the Mozilla wintools

Netscape has modified a handful of the GNU command-line tools to solve some problems mostly for makefile compatibility with the GNU-styled UNIX builds.

Unpack the zip file into a temporary directory. Then start a Command Prompt in the temporary directory and do:

set MOZ_TOOLS=c:\mozilla\moztools
mkdir c:\mozilla\moztools
cd buildtools\windows
install.bat

Get MinGW

Download the following set of MinGW packages:

Unpack all of the <tt>tar.gz</tt> files in <tt>c:\mozilla\mingw\</tt>. You can do this by placing all the <tt>tar.gz</tt> files in <tt>c:\mozilla\mingw\</tt> and then starting a Command Prompt and doing the following:

cd c:\mozilla\mingw\
c:\mozilla\cygwin\bin\gzip -d *.tar.gz
c:\mozilla\cygwin\bin\tar -xvf binutils-*
c:\mozilla\cygwin\bin\tar -xvf gcc-core-*
c:\mozilla\cygwin\bin\tar -xvf gcc-g++-*
c:\mozilla\cygwin\bin\tar -xvf mingw-runtime-*
c:\mozilla\cygwin\bin\tar -xvf w32api-*
del *.tar

Create the settings file

Create a file called mozset.bat in c:\mozilla\. The file should contain the following lines:

@echo off
set MOZ_TOOLS=c:\mozilla\moztools
set PATH=c:\mozilla\mingw\bin;c:\mozilla\cygwin\bin;%MOZ_TOOLS%\bin;%PATH%
set HOME=c:\mozilla
set CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot

Run the settings file

Get ready to get the Mozilla source code. Issue the following commands at the command prompt:

cd c:\mozilla\
mozset.bat

Keep the command prompt open after doing this.

Convert the headers into Unix format

Since we're on a Windows platform we have to convert the Mozilla wintools header files into Unix format.

cd c:\mozilla\moztools\include\
dos2unix.exe *.h
cd libIDL\
dos2unix.exe *.h

Now login to the CVS server

Log into the Mozilla CVS server:

cd c:\mozilla\
cvs login

Enter "anonymous" as the password when asked. You might get a warning like:

cvs login: warning: failed to open /cygdrive/c/mozilla/.cvspass for reading: No such file or directory

Just ignore it.

Get client.mk

Get the <tt>client.mk</tt> file which does all the magic:

cd c:\mozilla\
cvs checkout mozilla/client.mk

If you want to build Mozilla Firefox do

cd c:\mozilla\
cvs checkout mozilla/browser/config

If you want to build Mozilla Thunderbird do

cd c:\mozilla\
cvs checkout mozilla/mail/config

If you want to build Mozilla Sunbird do

cd c:\mozilla\
cvs checkout mozilla/calendar/sunbird/config

Create the .mozconfig file

Now you have to create a file called <tt>.mozconfig</tt> in <tt>c:\mozilla\mozilla\</tt> It should contain the following lines:

To build Mozilla Thunderbird in optimized mode:

. $topsrcdir/mail/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility

To build Mozilla Thunderbird in debug mode, that's with the debug information and console window:

. $topsrcdir/mail/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
ac_add_options --enable-debug
ac_add_options --disable-optimize

To build Mozilla Firefox in optimized mode:

. $topsrcdir/browser/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility

To build Mozilla Firefox in debug mode, that's with the debug information and console window:

. $topsrcdir/browser/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
ac_add_options --enable-debug
ac_add_options --disable-optimize

To build Mozilla Sunbird in optimized mode:

. $topsrcdir/calendar/sunbird/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility

To build Mozilla Sunbird in debug mode, that's with the debug information and console window:

. $topsrcdir/calendar/sunbird/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
ac_add_options --enable-debug
ac_add_options --disable-optimize

Get the source

Now you are ready to pull the source. This will take a long time!

cd c:\mozilla\mozilla\
make -f client.mk pull_all

It's much faster to download the source directly. You can get the source by downloading a tarball containing all the source files:

Build

Now build the bird! This will take a even longer than fetching the code; exactly how long depends on your system.

cd c:\mozilla\mozilla\
make -f client.mk build_all

If you want to log all warnings and errors to a file you can do it by doing:

cd c:\mozilla\mozilla\
make -f client.mk build_all > c:\mozilla\build.log 2>&1

The next time if want to update and build you can do this by doing:

cd c:\mozilla\mozilla\
make -f client.mk pull_and_build_all

Start it up

To start Mozilla Thunderbird:

cd c:\mozilla\mozilla\thunderbird\bin\
thunderbird.exe -console

To start Mozilla Firefox:

cd c:\mozilla\mozilla\dist\bin\
firefox.exe -console

Troubleshooting

Here are some helpful troubleshooting tips.

Make sure your tools are correct

First of all make sure that you're using the correct tools.

Test gcc
cd c:\mozilla\
mozset.bat
gcc -v

This should say gcc version 3.2.3 (mingw special 20030504-1). If it doesn't something is wrong.

Test make
cd c:\mozilla\
mozset.bat
make -v

This should say GNU Make 3.80. If it doesn't something is wrong.

Test uname
cd c:\mozilla\
mozset.bat
uname --version

This should say uname (sh-utils) 2.0.15. If it doesn't something is wrong. Double check that the path to your Cygwin binary directory is set up correctly in <tt>mozset.bat</tt>.

exec: cl: not found

make[4]: Entering directory `/cygdrive/c/mozilla/mozilla/nsprpub/config' sh /cygdrive/c/mozilla/mozilla/nsprpub/build/cygwin-wrapper cl -Fonow.obj -c -W3 -nologo -GF -Gy -MDd -Od -Z7 -UNDEBUG -DDEBUG_hege -UWINNT -DMOZILLA_CLIENT=1 -DDEBUG=1 -DXP_PC=1 -DWIN32=1 -D_DEBUG=1 -DWIN95=1 -D_PR_GLOBAL_THREADS_ONLY=1 -D_X86_=1 -DFORCE_PR_LOG /cygdrive/c/mozilla/mozilla/nsprpub/config/now.c
exec: cl: not found

This error means that it can't find the file <tt>cl</tt>. The <tt>cl</tt> file is the Microsoft Visual C++ compiler. You want to be using the gcc compiler instead of the MinGW compiler.

Solution: Double check that the path to your Cygwin binary directory is set up correctly in <tt>mozset.bat</tt>. Also make sure that the <tt>mingw</tt> path is before the MOZ_TOOLS path.

Problems with cdefs.h

If you're getting the error:

sys/cdefs.h: No such file or directory

Solution: Make sure that the mingw path is before the cygwin path.

Problems with glib.h

Solution: [{{ mediawiki.external('#Convert the headers into Unix format|Convert') }} the <tt>moztools</tt> header files with <tt>dos2unix</tt>.

Parse error

You see errors like this:

parse error before '*' token

Solution: [{{ mediawiki.external('#Convert the headers into Unix format|Convert') }} the <tt>moztools</tt> header files with <tt>dos2unix</tt>.

Missing midl

If you get this error:

"midl" c:/mozilla/mozilla/accessible/public/msaa/ISimpleDOMNode.idl
"midl" not found

Solution: The following options don't yet work under gcc-on-win32 so you have to disable them:

ac_add_options --disable-accessibility
ac_add_options --disable-activex

Currently the mingw headers and libraries don't emulate accessibility. Perhaps at a some point mingw will.

Problems with "vtable cant be auto-imported"

Some people have been having "vtable" problems when compiling. It says something like "variable vtable cant be auto-imported".

Solution: To fix this problem try adding the following to your .mozconfig:

LDFLAGS="-mwindows -Wl,--enable-runtime-pseudo-reloc"

Problems with missing icons

If you're having problem with the icons not being shown in Mozilla Thunderbird, it's because you didn't choose Unix as the default file type when installing cygwin.

cd c:\mozilla\
mozset.bat
mount

Then it must say:

C:\mozilla\cygwin\bin on /usr/bin type system (binmode)
C:\mozilla\cygwin\lib on /usr/lib type system (binmode)
C:\mozilla\cygwin on / type system (binmode)
c: on /cygdrive/c type user (binmode,noumount)

The important thing is that it says "binmode" and not "textmode". Otherwise your icons will be corrupted.

Solution: Copy the chrome directory over from a "real" Mozilla Thunderbird build.

No build ID

If you build Mozilla and it doesn't have a build ID, you should add the following to your <tt>mozset.bat</tt> file set:

MOZILLA_OFFICIAL=1
set BUILD_OFFICIAL=1 

See also

Original Document Information

  • Author(s): Henrik Gemal
  • Last Updated Date: February 6, 2008
  • Copyright Information: 1995-2006 Henrik Gemal

Revision Source

<p>{{ Note("This page used to be linked from <a href='\"en/Windows_Build_Prerequisites\"'>Windows Build Prerequisites</a> and should be again.") }}
</p><p>This article explains how to use Mingw to build Mozilla projects on Windows without using Microsoft Visual Studio, in 14 steps. The versions built using these instructions are debug builds.
</p>
<h3 name="Disk_space_requirements">Disk space requirements</h3>
<p>You will need at least 3.7 GB of free disk space in order to download the source code and install the needed build tools, as well as to build the software.
</p>
<h3 name="Create_the_main_directory">Create the main directory</h3>
<p>All the tools and code will be located in <tt>C:\mozilla\</tt>, so create this directory first. From a command prompt, issue the command:
</p>
<pre class="eval">mkdir C:\mozilla\
</pre>
<h3 name="Get_the_GNU_tools_for_Microsoft_Windows_.28Cygwin.29">Get the GNU tools for Microsoft Windows (Cygwin)</h3>
<p>Download the Cygwin tools for Windows. This is a special version of the GNU tools that runs on Windows:</p>
<ul> <li><a class="external" href="http://www.cygwin.com/setup.exe">Download</a></li> <li><a class="external" href="http://www.cygwin.com/">Information</a></li>
</ul>
<p>Install the tools into <code>C:\mozilla\cygwin\</code>. Remember to choose Unix as the Default Text File Type.</p>
<p><img alt="Image:Cygwin04.png" class="internal" src="/@api/deki/files/171/=Cygwin04.png"></p>
<p>In addition to the default modules, you need to install:</p>
<ul> <li>cvs (Devel)</li> <li>cygutils (Utils)</li> <li>make (Devel)</li> <li>patch (Utils)</li> <li>patchutils (Devel)</li> <li>perl (Perl)</li> <li>unzip (Archive)</li> <li>zip (Archive)</li>
</ul>
<p>To select these optional installs, press the View button in the Select Packages part of the installer.</p>
<p><img alt="Image:Cygwin08.png" class="internal" src="/@api/deki/files/172/=Cygwin08.png"></p>
<p>The following needed modules should be part of the default install, but you may wish to confirm that they're selected:</p>
<ul> <li>ash</li> <li>diffutils</li> <li>fileutils</li> <li>findutils</li> <li>gawk</li> <li>grep</li> <li>sed</li> <li>sh-utils</li> <li>textutils</li>
</ul>
<p>Only make 3.81 is available through the cygwin installer but will not work for building mozilla sources.  Instead you need to manually replace C:\mozilla\cygwin\bin\make with version 3.80.  You can grab it from this <a class=" external" href="http://www.go-mono.com/archive/helper/make-3.80-1.tar.bz2" title="http://www.go-mono.com/archive/helper/make-3.80-1.tar.bz2">go-mono download</a>.</p><h3 name="Get_the_Mozilla_wintools">Get the Mozilla wintools</h3>
<p>Netscape has modified a handful of the GNU command-line tools to solve some problems mostly for makefile compatibility with the GNU-styled UNIX builds.
</p>
<ul><li> <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip">Download</a>
</li></ul>
<p>Unpack the zip file into a temporary directory. Then start a Command Prompt in the temporary directory and do:
</p>
<pre class="eval">set MOZ_TOOLS=c:\mozilla\moztools
mkdir c:\mozilla\moztools
cd buildtools\windows
install.bat
</pre>
<h3 name="Get_MinGW">Get MinGW</h3>
<p>Download the following set of <a class="external" href="http://www.mingw.org/download.shtml">MinGW</a> packages:
</p>
<ul><li> <a class="external" href="http://www.mingw.org/download.shtml#hdr2">gcc-core</a>
</li><li> <a class="external" href="http://www.mingw.org/download.shtml#hdr2">gcc-g++</a>
</li><li> <a class="external" href="http://www.mingw.org/download.shtml#hdr2">binutils</a>
</li><li> <a class="external" href="http://www.mingw.org/download.shtml#hdr2">w32api</a>
</li><li> <a class="external" href="http://www.mingw.org/download.shtml#hdr2">mingw-runtime</a>
</li></ul>
<p>Unpack all of the <tt>tar.gz</tt> files in <tt>c:\mozilla\mingw\</tt>. You can do this by placing all the <tt>tar.gz</tt> files in <tt>c:\mozilla\mingw\</tt> and then starting a Command Prompt and doing the following:
</p>
<pre class="eval">cd c:\mozilla\mingw\
c:\mozilla\cygwin\bin\gzip -d *.tar.gz
c:\mozilla\cygwin\bin\tar -xvf binutils-*
c:\mozilla\cygwin\bin\tar -xvf gcc-core-*
c:\mozilla\cygwin\bin\tar -xvf gcc-g++-*
c:\mozilla\cygwin\bin\tar -xvf mingw-runtime-*
c:\mozilla\cygwin\bin\tar -xvf w32api-*
del *.tar
</pre>
<h3 name="Create_the_settings_file">Create the settings file</h3>
<p>Create a file called mozset.bat in c:\mozilla\. The file should contain the following lines:
</p>
<pre class="eval">@echo off
set MOZ_TOOLS=c:\mozilla\moztools
set PATH=c:\mozilla\mingw\bin;c:\mozilla\cygwin\bin;%MOZ_TOOLS%\bin;%PATH%
set HOME=c:\mozilla
set <a class=" link-mailto" href="mailto:CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot
</pre>
<h3 name="Run_the_settings_file">Run the settings file</h3>
<p>Get ready to get the Mozilla source code. Issue the following commands at the command prompt:
</p>
<pre class="eval">cd c:\mozilla\
mozset.bat
</pre>
<p>Keep the command prompt open after doing this.
</p>
<h3 name="Convert_the_headers_into_Unix_format">Convert the headers into Unix format</h3>
<p>Since we're on a Windows platform we have to convert the Mozilla wintools header files into Unix format.
</p>
<pre class="eval">cd c:\mozilla\moztools\include\
dos2unix.exe *.h
cd libIDL\
dos2unix.exe *.h
</pre>
<h3 name="Now_login_to_the_CVS_server">Now login to the CVS server</h3>
<p>Log into the Mozilla CVS server:
</p>
<pre class="eval">cd c:\mozilla\
cvs login
</pre>
<p>Enter "anonymous" as the password when asked. You might get a warning like:
</p>
<pre class="eval">cvs login: warning: failed to open /cygdrive/c/mozilla/.cvspass for reading: No such file or directory
</pre>
<p>Just ignore it. </p>
<h3 name="Get_client.mk">Get client.mk</h3>
<p>Get the <tt>client.mk</tt> file which does all the magic:
</p>
<pre class="eval">cd c:\mozilla\
cvs checkout mozilla/client.mk
</pre>
<p>If you want to build Mozilla Firefox do
</p>
<pre class="eval">cd c:\mozilla\
cvs checkout mozilla/browser/config
</pre>
<p>If you want to build Mozilla Thunderbird do
</p>
<pre class="eval">cd c:\mozilla\
cvs checkout mozilla/mail/config
</pre>
<p>If you want to build Mozilla Sunbird do
</p>
<pre class="eval">cd c:\mozilla\
cvs checkout mozilla/calendar/sunbird/config
</pre>
<h3 name="Create_the_.mozconfig_file">Create the .mozconfig file</h3>
<p>Now you have to create a file called <tt>.mozconfig</tt> in <tt>c:\mozilla\mozilla\</tt>
It should contain the following lines:
</p><p>To build Mozilla Thunderbird in optimized mode:
</p>
<pre>. $topsrcdir/mail/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
</pre>
<p>To build Mozilla Thunderbird in debug mode, that's with the debug information and console window:
</p>
<pre>. $topsrcdir/mail/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
ac_add_options --enable-debug
ac_add_options --disable-optimize
</pre>
<p>To build Mozilla Firefox in optimized mode:
</p>
<pre>. $topsrcdir/browser/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
</pre>
<p>To build Mozilla Firefox in debug mode, that's with the debug information and console window:
</p>
<pre>. $topsrcdir/browser/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
ac_add_options --enable-debug
ac_add_options --disable-optimize
</pre>
<p>To build Mozilla Sunbird in optimized mode:
</p>
<pre>. $topsrcdir/calendar/sunbird/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
</pre>
<p>To build Mozilla Sunbird in debug mode, that's with the debug information and console window:
</p>
<pre>. $topsrcdir/calendar/sunbird/config/mozconfig
CC=gcc
CXX=g++
CPP=cpp
AS=as
LD=ld
ac_add_options --disable-accessibility
ac_add_options --enable-debug
ac_add_options --disable-optimize
</pre>
<h3 name="Get_the_source">Get the source</h3>
<p>Now you are ready to pull the source. This will take a long time!
</p>
<pre class="eval">cd c:\mozilla\mozilla\
make -f client.mk pull_all
</pre>
<p>It's much faster to download the source directly. You can get the source by downloading a tarball containing all the source files:
</p>
<ul><li> <a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/mozilla/nightly/latest/mozilla-source.tar.gz">Download latest nightly source</a>
</li><li> <a class="external" href="http://mozilla.org/download-mozilla.html">Information</a>
</li></ul>
<h3 name="Build">Build</h3>
<p>Now build the bird! This will take a even longer than fetching the code; exactly how long depends on your system.
</p>
<pre class="eval">cd c:\mozilla\mozilla\
make -f client.mk build_all
</pre>
<p>If you want to log all warnings and errors to a file you can do it by doing:
</p>
<pre class="eval">cd c:\mozilla\mozilla\
make -f client.mk build_all &gt; c:\mozilla\build.log 2&gt;&amp;1
</pre>
<p>The next time if want to update and build you can do this by doing:
</p>
<pre class="eval">cd c:\mozilla\mozilla\
make -f client.mk pull_and_build_all
</pre>
<h3 name="Start_it_up">Start it up</h3>
<p>To start Mozilla Thunderbird:
</p>
<pre class="eval">cd c:\mozilla\mozilla\thunderbird\bin\
thunderbird.exe -console
</pre>
<p>To start Mozilla Firefox:
</p>
<pre class="eval">cd c:\mozilla\mozilla\dist\bin\
firefox.exe -console
</pre>
<h3 name="Troubleshooting">Troubleshooting</h3>
<p>Here are some helpful troubleshooting tips.
</p>
<h4 name="Make_sure_your_tools_are_correct">Make sure your tools are correct</h4>
<p>First of all make sure that you're using the correct tools.
</p>
<h5 name="Test_gcc">Test gcc</h5>
<pre class="eval">cd c:\mozilla\
mozset.bat
gcc -v
</pre>
<p>This should say gcc version 3.2.3 (mingw special 20030504-1). If it doesn't something is wrong.
</p>
<h5 name="Test_make">Test make</h5>
<pre class="eval">cd c:\mozilla\
mozset.bat
make -v</pre>
<p>This should say GNU Make 3.80. If it doesn't something is wrong.</p><h5 name="Test_uname">Test uname</h5>
<pre class="eval">cd c:\mozilla\
mozset.bat
uname --version
</pre>
<p>This should say uname (sh-utils) 2.0.15. If it doesn't something is wrong. Double check that the path to your Cygwin binary directory is set up correctly in <tt>mozset.bat</tt>. </p>
<h4 name="exec:_cl:_not_found">exec: cl: not found</h4>
<pre>make[4]: Entering directory `/cygdrive/c/mozilla/mozilla/nsprpub/config' sh /cygdrive/c/mozilla/mozilla/nsprpub/build/cygwin-wrapper cl -Fonow.obj -c -W3 -nologo -GF -Gy -MDd -Od -Z7 -UNDEBUG -DDEBUG_hege -UWINNT -DMOZILLA_CLIENT=1 -DDEBUG=1 -DXP_PC=1 -DWIN32=1 -D_DEBUG=1 -DWIN95=1 -D_PR_GLOBAL_THREADS_ONLY=1 -D_X86_=1 -DFORCE_PR_LOG /cygdrive/c/mozilla/mozilla/nsprpub/config/now.c
exec: cl: not found
</pre>
<p>This error means that it can't find the file <tt>cl</tt>. The <tt>cl</tt> file is the Microsoft Visual C++ compiler. You want to be using the gcc compiler instead of the MinGW compiler.
</p><p><b>Solution:</b> Double check that the path to your Cygwin binary directory is set up correctly in <tt>mozset.bat</tt>. Also make sure that the <tt>mingw</tt> path is before the <code>MOZ_TOOLS</code> path. </p>
<h4 name="Problems_with_cdefs.h">Problems with cdefs.h</h4>
<p>If you're getting the error:
</p>
<pre class="eval">sys/cdefs.h: No such file or directory
</pre>
<p><b>Solution:</b> Make sure that the mingw path is before the cygwin path.
</p>
<h4 name="Problems_with_glib.h">Problems with glib.h</h4>
<p><b>Solution:</b> [{{ mediawiki.external('#Convert the headers into Unix format|Convert') }} the <tt>moztools</tt> header files with <tt>dos2unix</tt>.
</p>
<h4 name="Parse_error">Parse error</h4>
<p>You see errors like this:
</p>
<pre class="eval">parse error before '*' token
</pre>
<p><b>Solution:</b> [{{ mediawiki.external('#Convert the headers into Unix format|Convert') }} the <tt>moztools</tt> header files with <tt>dos2unix</tt>.
</p>
<h4 name="Missing_midl">Missing midl</h4>
<p>If you get this error:
</p>
<pre class="eval">"midl" c:/mozilla/mozilla/accessible/public/msaa/ISimpleDOMNode.idl
"midl" not found
</pre>
<p><b>Solution:</b> The following options don't yet work under gcc-on-win32 so you have to disable them:
</p>
<pre class="eval">ac_add_options --disable-accessibility
ac_add_options --disable-activex
</pre>
<p>Currently the mingw headers and libraries don't emulate accessibility. Perhaps at a some point mingw will.
</p>
<h4 name="Problems_with_.22vtable_cant_be_auto-imported.22">Problems with "vtable cant be auto-imported"</h4>
<p>Some people have been having "vtable" problems when compiling. It says something like "variable vtable cant be auto-imported".
</p><p><b>Solution:</b> To fix this problem try adding the following to your .mozconfig:
</p>
<pre class="eval">LDFLAGS="-mwindows -Wl,--enable-runtime-pseudo-reloc"
</pre>
<h4 name="Problems_with_missing_icons">Problems with missing icons</h4>
<p>If you're having problem with the icons not being shown in Mozilla Thunderbird, it's because you didn't choose Unix as the default file type when installing cygwin.
</p>
<pre class="eval">cd c:\mozilla\
mozset.bat
mount
</pre>
<p>Then it must say:
</p>
<pre class="eval">C:\mozilla\cygwin\bin on /usr/bin type system (binmode)
C:\mozilla\cygwin\lib on /usr/lib type system (binmode)
C:\mozilla\cygwin on / type system (binmode)
c: on /cygdrive/c type user (binmode,noumount)
</pre>
<p>The important thing is that it says "binmode" and not "textmode". Otherwise your icons will be corrupted.
</p><p><b>Solution:</b> Copy the chrome directory over from a "real" Mozilla Thunderbird build.
</p>
<h4 name="No_build_ID">No build ID</h4>
<p>If you build Mozilla and it doesn't have a build ID, you should add the following to your <tt>mozset.bat</tt> file set:
</p>
<pre class="eval">MOZILLA_OFFICIAL=1
set BUILD_OFFICIAL=1 
</pre>
<h3 name="See_also">See also</h3>
<ul> <li><a href="/en/Build_Documentation" title="en/Build_Documentation">Build Documentation</a></li> <li><a href="/en/Windows_Build_Prerequisites" title="en/Windows_Build_Prerequisites">Windows Build Prerequisites</a></li> <li><a href="/en/Mozilla_Build_FAQ" title="en/Mozilla_Build_FAQ">Mozilla Build FAQ</a></li> <li><a class="internal" href="/En/Cross%20Compile%20Mozilla%20for%20Mingw32" title="En/Cross Compile Mozilla for Mingw32">Cross Compile Mozilla for Mingw32</a></li>
</ul>
<div class="originaldocinfo">
<h2 name="Original_Document_Information">Original Document Information</h2>
<ul> <li>Author(s): Henrik Gemal</li> <li>Last Updated Date: February 6, 2008</li> <li>Copyright Information: 1995-2006 Henrik Gemal</li>
</ul>
</div>
Revert to this revision