y0?

30.11.05

Comments on Building Mozilla with the Free MS VC++

Tags: — Jeff @ 0:01

I’ve split comments from the main article on compiling Firefox or Thunderbird using the free MS Visual C++ Toolkit to make it more readable and usable. I’m keeping the most recent comments on this page, and I’ll periodically move older comments elsewhere as the instructions change and comments become less relevant. This page will always contain the most recent comments; links to archived comments will be found immediately below this paragraph as I create them.

I plan to move all current comments to a separate archive page when I next fully update the instructions to the latest Mozilla source code and MS toolchain and SDK, which should be around Christmas.

51 Comments »

  1. Thanks for the instructions. My download from MicroSoft installed to c:\program files\microsoft platform sdk\ so I had to modify your buildsetup.bat file accordingly. I also had to comment out line 78 - 80 of …\microsoft platform sdk\include\atl\atlbase.h which was trying to include atl.lib (which apparently is for ActiveX and isn’t included). The build fails at webshell\tests\viewer, but Firefox actually compiles and runs.

    Cheers

    Comment by Darren — 16.05.05 @ 15:52

  2. i get the VCToolkits and the Platform SDK, but it seemed that there aren’t some file: lib.exe and msvcrt.ib,msvcrpt.lib, so i coulnt continue my make

    Comment by bearsprite — 18.05.05 @ 7:37

  3. Microsoft has replaced the Windows SDK Update site with the Windows 2003 SP1 Platform SDK, which now provides a small installer that then fetches the required files — this means that the page now works in Firefox or IE.

    After some trial and failure, I discovered that the minimal set of packages required to get a working build are:

    * Microsoft Windows Core SDK (Tools, Build Environment, Redistributable Components)
    * Microsoft Web Workshop SDK (Build Environment)

    Also, FWIW, Make 3.80 and cygwin perl seem to work fine now.

    Comment by Mike Beltzner — 27.05.05 @ 15:26

  4. I followed your guide, and had to fix the following things to get it to build all the way:

    Modify buildsetup.bat to fix the paths for the Microsoft Platform SDK (”Microsoft SDK” -> “Microsoft Platform SDK”)

    Added “set NO_MFC=1″ to buildsetup.bat, to prevent MFC-related (test) code from being built (not necessary, and it missed a library)

    Added C:\Program Files\Microsoft Platform SDK\include\atl to the INCLUDE var in buildsetup.bat

    Edited C:\Program Files\Microsoft Platform SDK\include\atl\
    atlbase.h and removed the line “#pragma comment(lib, “atlthunk.lib”) - this lib does not exist, nor does it seem to be used by anything at all.

    Checked out the initial CVS files with -r AVIARY_1_0_1_20050124_BRANCH tag, needed to build firefox.

    Edited mozilla\configure.in and mozilla\configure to reflect the new MIDL version used by the Platform SDK (if test “$_MIDL_MAJOR_VERSION” != “5″ -a “$_MIDL_FULL_VERSION” != “6.00.0347″ -a “$_MIDL_FULL_VERSION” != “6.00.0366″; then)

    Added these options to the .mozconfig:
    mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
    ac_add_options –disable-debug
    ac_add_options –disable-tests (some didn’t compile)
    ac_add_options –enable-optimize

    Finally, I edited mozilla\build\autoconf\make-makefile to allow the MOZ_OBJDIR to work:
    160c160
    system “mkdir -p “. join(’ ‘, map(”\”$_\”", @dirs)) if @dirs;

    Comment by Bram Avontuur — 06.06.05 @ 11:30

  5. Where Bram says:

    Added C:\Program Files\Microsoft Platform SDK\include\atl to the INCLUDE var in buildsetup.bat

    You could also just modify the existing string that includes C:\program files\micrsosoft platform sdk\include\win64\atl, as there’s no more {..}\win64 directory :)

    Comment by Mike Beltzner — 09.06.05 @ 11:31

  6. I got the following error in trying to build using:

    make -f client.mk build

    C:\moz\mozilla>make -f client.mk build
    Adding client.mk options from /cygdrive/c/moz/mozilla/.mozconfig:
    MOZ_CO_PROJECT=browser
    BUILD_OFFICIAL=1
    MOZILLA_OFFICIAL=1
    MOZ_OBJDIR=$(TOPSRCDIR)/objdir
    cd /cygdrive/c/moz/mozilla/objdir
    /cygdrive/c/moz/mozilla/configure
    Adding configure options from /cygdrive/c/moz/mozilla/.mozconfig:
    –enable-application=browser
    –disable-shared
    –enable-static
    –disable-activex
    –disable-activex-scripting
    –disable-debug
    –disable-tests
    –enable-optimize
    creating cache ./config.cache
    checking host system type… i586-pc-msvc
    checking target system type… i586-pc-msvc
    checking build system type… i586-pc-msvc
    checking for gcc… cl
    checking whether the C compiler (cl ) works… no
    configure: error: installation or configuration problem: C compiler cannot creat
    e executables.
    *** Fix above errors and then restart with “make -f client.mk build”
    make: *** [/cygdrive/c/moz/mozilla/objdir/Makefile] Error 1

    —- Any suggestions ??!!

    TIA

    Comment by James — 13.06.05 @ 16:00

  7. Good write up. There are a couple of things I had to do that were not yet in the docs or comments.

    1. lib.exe missing. There is a lib.exe that comes with Masm but it doesn’t seem to work for Mozilla.
    The site below had some tips on this.

    http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit

    I took one of their suggests and just used lib.exe from platform-SDK/Bin/win64 on my win32 platform.

    Also msvcprt.lib was missing. I used the directions on the following site to create it from the dll.

    http://libsh.org/win32/build.html

    Comment by Christopher Nebergall — 19.06.05 @ 1:56

  8. James:

    I’ve seen that error before on other build pages, and the solution is usually to run vcvars32.bat before compiling. Here, of course, that won’t work because we’ve got everything in buildsetup.bat. Right now, I’m not sure what your problem is.

    Anyway, tho, it’s time for me to update these instructions. I know Microsoft updated their SDKs and stuff recently, but I’m not really interested in breaking what works without a good reason. I just recently formatted my hard drive, tho, to install Fedora Core 4 and reinstall Windows XP, so I’ve got a clean slate and need to get things working again. Look for an update to these instructions sometime soon.

    Comment by Jeff — 20.06.05 @ 9:33

  9. You’ve got a
    LNK2019: unresolved external symbol @__security_check_cookie@4
    just like me right now
    Building with Windows 2003 DDK (also free)
    I do not know how to fix this when using GNU make
    We need to add a link to BufferOverflowU.lib
    Do anyone know how to do this?

    Comment by Jerker — 20.06.05 @ 18:23

  10. This seems to work so far:
    export LDFLAGS=bufferoverflowu.lib

    answer Bram Avontuur:
    “Edited C:\Program Files\Microsoft Platform SDK\include\atl\
    atlbase.h and removed the line “#pragma comment(lib, “atlthunk.lib”) - this lib does not exist, nor does it seem to be used by anything at all.”
    uff - never, never, edit system include files! It is used by Windows 2003 SP1 version of ATL3. If you do not have the lib you can build your own from the src folder.

    jerker

    Comment by Jerker — 20.06.05 @ 19:48

  11. If your C compiler will not be found, you should have a look in your local /mozilla/ CVS directory. Delete config.cache

    In my case in config.cache was an old link to gcc instead of MSVC.

    Comment by Alexander Ihrig — 21.06.05 @ 18:56

  12. One of the checkins for changed mozilla/browser/components/build/nsModule.cpp and now the build patch no longer works and thus the build fails. Is there an updated disable-ie-migrator.diff available or what needs to be changed in the current one so that the build process works again?

    TIA,
    RainerG

    [I'll get on that sometime in the next couple days. In the meantime, open the patch up in a text editor and try making the changes manually - the syntax for patches is reasonably clear, so you should be able to make the few changes in the patch yourself.]

    Comment by RainerG — 23.06.05 @ 5:22

  13. Sorry about the error in my last post. I wanted to include the link to Bug# 274374, but the URL doesn’t show up in the post.

    RainerG

    Comment by RainerG — 23.06.05 @ 5:25

  14. I followed all the directions in addition to those given by Bram and I get the following errors:

    /out:now.exe
    now.obj
    now.obj : error LNK2019: unresolved external symbol __imp__iob referenced in function .main
    now.obj : error LNK2019: unresolved external symbol __imp_fprintf referenced in function .main
    now.obj : error LNK2019: unresolved external symbol __imp_GetSystemTimeAsFileTime referenced in function .main
    LINK : error LNK2001: unresolved external symbol mainCRTStartup
    now.exe : fatal error LNK1120: 4 unresolved externals
    make[4]: Leaving directory `/cygdrive/c/moz/mozilla/objdir/nsprpub/config’
    make[3]: Leaving directory `/cygdrive/c/moz/mozilla/objdir/nsprpub’
    make[2]: Leaving directory `/cygdrive/c/moz/mozilla/objdir’
    make[1]: Leaving directory `/cygdrive/c/moz/mozilla/objdir’

    I’ve been all over the web in the last couple days trying to figure this out with no luck. Anybody know what this means, specifically how to fix it?

    [I actually spent a little time looking into this a week or so ago and got to the exact same point. Figuring some fiddling with PATH/LIBS/INCLUDE would do it, I spent a couple hours trying various combinations and searching through MSDN docs to see the dependencies of the referenced symbols. I too found nothing. I haven't given up hope yet, because being able to build on Windows is really, really nice, but it's taken something of a back burner as deadlines for Firefox 1.1 are coming soon and I can't afford to spend time on this when I still have a working Linux build environment. I'll keep people posted as things change.

    By the way, I did manage to poke the right people to get rid of the midl version check, which was something that needed to be fixed to get compilation out-of-the-box. I only wish the rest of the problems could be so easily fixed...
    -Jeff]

    Comment by JOSH — 24.06.05 @ 12:00

  15. > no GUI debugger exists

    I use the Microsofts “debugging tools for windows”. It’s a very mighty debugger and I prefer it over Visual Studio, if there were not those two shortcommings:
    *) No integrated IDE
    *) Very bad and lousy variable watch functionality

    http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

    Daniel

    Comment by Daniel de Wildt — 29.06.05 @ 11:29

  16. followed the instructions exactly, and i have a question. is it natural for a build run to spit this out over and over again?

    make -f /cygdrive/c/moz/mozilla/client.mk build
    make[246]: Entering directory `/cygdrive/c/moz/mozilla’
    Adding client.mk options from /cygdrive/c/moz/.mozconfig:
    MOZ_CO_PROJECT=browser
    BUILD_OFFICIAL=1
    MOZILLA_OFFICIAL=1

    i used to use gcc in gentoo linux, so im not used to seeing this sort of thing happening. also, normally when something is compiling my cpu should be used fully, but when that loop is going on it jumps between 2 and 80%. also just noticed that make.exe decided to dupe itself in process manager hundreds of times over. anyone have an idea what i did wrong?

    [Both of the things you describe are perfectly normal. The first issue is something I've seen forever in builds on both Windows and Linux; I don't know why gentoo wouldn't have displayed them. The second is just a result of how the make code works: it spawns a new instance of make for each subdirectory (usually - it doesn't always happen this way), and each instance closes when all the code in the instance's directory has been processed. You shouldn't see more instances of make than the largest folder depth in your tree, tho, so you're not going to be straining the system that much.]

    Comment by pika unforgiven — 03.07.05 @ 18:53

  17. I have got MS Visual Studio dotNET install(full tank) with docs.
    I have downloaded GECKO.

    I have made all bin+lib+includes as env variable.

    I have uncompressed firefox 1.0.4 from the ftp://mozilla.org/

    I am behind a LAN environment;
    Problem:
    I dont where to download ssh.

    Basically I am stuck in the stage:
    Creating Build Configuration Files.

    I want to use XPCOM and all components with dotNET(VC++).

    Comment by FireHead — 07.07.05 @ 0:30

  18. Hello Again.

    I have downloaded PSDK.
    And now the configure tool is failing on the wrong MIDL compilter vesion.

    What do I do?

    Comment by FireHead — 08.07.05 @ 2:53

  19. You can download graphical debugging tools from MSDN. I’m sure that they will work with the command line tools.

    Comment by Chris Trueman — 14.07.05 @ 12:11

  20. /cygdrive/c/firefox/mozilla/configure: line 5501: cd: C:\moztools: No such file or directory.
    configure: error: cd $MOZ_TOOLS failed. MOZ_TOOLS ==? C:\moztools.

    Does not work.

    [Did you make sure to run buildsetup.bat? I didn't actually mention it in there, it seems (I changed it before approving your comment), so that's probably your problem.]

    Comment by mike — 17.07.05 @ 0:30

  21. I have the same problem as Jeff/Josh described on 6/24/2005. I really want to be able to make my own compiles since the moox guy is now to busy to get them out soon. It’s some kind of problem with the standard libraries. So far I’ve had to make some annoying modificatins because the instructions are outdated:

    1. Change “Microsoft SDK” to “Microsoft Platform SDK” in buildsetup.bat.

    2. Open the MSVC++ command prompt and add c:\path\to\cygwin\bin to the path (not specified in the instructions).

    3. Modify configure to change the version number for the midl.exe check to accept the newer version.

    4. I’ve modified some build flags in files in mozilla\buildtools\windows\source\make-… to be /G7 (Pentium/Athlon optimization) instead of /Gx, but I don’t think that’s sufficient for modifying the optimization flags. I can’t find where to completely change the optimization flags and seems like ‘/mozilla/nsprpub/build/cygwin-wrapper’ has its own flags.

    Anyway, I hope someone figures out how to fix this for the latest MSVC++ 2003 compiler, Windows XP and the latest (windows server 2003) Platform SDK.

    I’m also wondering, since the mozilla people go to so much effort in porting to so many platforms, why doesn’t it have a native make fiel for MSVC++? I just don’t get it. And what compiler are they using anyway for their release?

    [A couple notes: On #2, that's probably because I errantly forgot to mention that you have to run buildsetup.bat before you check out or build code. #3 should be fixed in trunk code now, because I got them to remove the check because it was obsolete. As for #4, I don't know what you need to do there, unfortunately. :-( ]

    Comment by Nathan J. Yoder — 17.07.05 @ 1:40

  22. sorry but I had this output when i tried to build it:

    /cygdrive/c/moz/mozilla/configure: line 5501: cd: C:\moztools: No such file or directory.
    configure: error: cd $MOZ_TOOLS failed. MOZ_TOOLS ==? C:\moztools.

    is this related to .mozconfig?

    [This is probably me not specifying that you have to run c:\moz\buildsetup.bat before you attempt to check out new code or start a build; I added that to the instructions.]

    Comment by mike — 18.07.05 @ 5:54

  23. configure: error: Midl version 6.00.0366 was found. Midl version must be 5.x.x (VC6*) or 6.00.0347 (VC7) or
    6.00.0361 (VC.net 2003).

    How should I fix that? Five ten-thousandth of updating should cause that much of a problem!

    [This should be fixed now, as I mentioned in previous comments.]

    Comment by Meat_Head — 18.07.05 @ 19:35

  24. I have created a german version based on the document and the comments.

    [Cool!]

    Comment by JAK-Software.de - SeaMonkey — 24.07.05 @ 13:11

  25. I get:
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80×86
    Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

    Microsoft (R) Incremental Linker Version 7.10.3077
    Copyright (C) Microsoft Corporation. All rights reserved.

    /out:now.exe
    now.obj
    now.obj : error LNK2019: unresolved external symbol __imp__GetSystemTimeAsFileTime@4 referenced in function _main
    now.obj : error LNK2019: unresolved external symbol __alldiv referenced in function _main
    LINK : error LNK2001: unresolved external symbol _mainCRTStartup
    now.exe : fatal error LNK1120: 3 unresolved externals
    make[4]: *** [now.exe] Error 2
    make[4]: Leaving directory `/cygdrive/c/moz/mozilla/nsprpub/config’
    make[3]: *** [export] Error 2
    make[3]: Leaving directory `/cygdrive/c/moz/mozilla/nsprpub’
    make[2]: *** [nspr] Error 2
    make[2]: Leaving directory `/cygdrive/c/moz/mozilla’
    make[1]: *** [default] Error 2
    make[1]: Leaving directory `/cygdrive/c/moz/mozilla’
    make: *** [build] Error 2

    My Lib Variable is:
    LIB=C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;C:\Program Files\Microsoft Platform SDK\Lib;C:\Program Files\Microsoft.NET\SDK\v1.1\Lib;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib;C:\masm32\LIB;C:\lcc\lib

    The C:\lcc\lib is to add USER32.LIB, which isn’t in the toolkit or Platform directories.
    The first KERNEL32.lib encountered is in the toolkit directory and it has __imp__GetSystemTimeAsFileTime

    I switched C:\lcc\lib to the front, still doesn’t work. I should mention I don’t actually have the .NET SDK.

    [I'm actually not sure the .NET SDK is needed, but I wasn't able to test while the old SDK was still around.]

    Comment by Robert Claypool — 13.08.05 @ 22:38

  26. I got rid of the tests for defines at the beginning of now.c typed CL now.c and got NOW.EXE to compile. Currently using cygwin Make 3.79.1-7

    Comment by Robert Claypool — 15.08.05 @ 20:30

  27. New Error:
    make[5]: *** [nspr4_s.lib] Error 5
    make[5]: Leaving directory `/cygdrive/c/moz/mozilla/nsprpub/pr/src’
    make[4]: *** [export] Error 2

    Comment by Robert Claypool — 15.08.05 @ 20:35

  28. Just got this
    configure: error: this version of the MSVC compiler is not supported as 08/15/2005. Building tip of tree.

    Comment by gary johnson — 15.08.05 @ 23:46

  29. I tried to use Microsoft’s Visual Studio 8 beta on Win XP Pro.

    The problems that I encounter are in :
    C:\moz\mozilla\js\src\xpconnect\src

    There seems to be some implicit castings that are no longer
    allowed in the new compiler release.

    Does any one know what CL options I need to use to override these errors, and make the behavior as we find in the V7 compiler?

    Thanks,
    Bill

    Comment by Bill — 22.08.05 @ 2:46

  30. the 08/15/2005 error has been fixed as of 08/17/2005. This applied to trunk builds. This was my fault, I had checked out when the tree was RED.

    Comment by gary johnson — 22.08.05 @ 10:37

  31. James,
    If you haven’t figured it out yet, the path in buildconfig.bat
    is wrong for your site. There are a couple of issues.

    For some reason there’s an errant win64 directory in there.
    The path to the 32 bit CL isn’t there.

    There’s some fun with the ordering to. PATCH exists in
    both cygwin/bin and system32. Link exists in cygwin and
    the VC7 directories. You want the Visual Studio directory
    then cygwin then system32.

    Comment by Ron Natalie — 24.08.05 @ 15:37

  32. The same version problem:

    configure: error: this version of the MSVC compiler is not supported as

    CL -v says version is 13.10.3077 :-(

    Any hint?

    Comment by Demián Gutierrez — 24.08.05 @ 19:19

  33. Hello,

    I trying to build Thunderbird using MSVC toolkit. But stuck on this error:

    make[5]: *** [nspr4_s.lib] Error 128
    make[5]: Leaving directory `/cygdrive/d/WorkIdea/mozilla/nsprpub/pr/src’
    make[4]: *** [export] Error 2
    make[4]: Leaving directory `/cygdrive/d/WorkIdea/mozilla/nsprpub/pr’
    make[3]: *** [export] Error 2
    make[3]: Leaving directory `/cygdrive/d/WorkIdea/mozilla/nsprpub’
    make[2]: *** [nspr] Error 2
    make[2]: Leaving directory `/cygdrive/d/WorkIdea/mozilla’
    make[1]: *** [default] Error 2
    make[1]: Leaving directory `/cygdrive/d/WorkIdea/mozilla’
    make: *** [build] Error 2

    I saw, that Robert Claypool had very similar problem. Do you know, how to fix it.

    That’s for any help.

    Comment by Victor Ronin — 29.08.05 @ 10:41

  34. I am getting this problem.

    D:\moz\mozilla>make -f client.mk build
    cd /cygdrive/d/moz/mozilla
    /cygdrive/d/moz/mozilla/configure
    loading cache ./config.cache
    checking host system type… i686-pc-cygwin
    checking target system type… i686-pc-cygwin
    checking build system type… i686-pc-cygwin
    checking for gcc… cl
    checking whether the C compiler (cl ) works… no
    configure: error: installation or configuration problem: C compiler cannot create executables.
    *** Fix above errors and then restart with “make -f client.mk build”
    make: *** [/cygdrive/d/moz/mozilla/Makefile] Error 1

    i have MS VS .Net installed on my machine and changed the path in buidsetp.bat to point ot the VS .net installation

    Any help on this will be helpful

    Thanks
    Manish

    Comment by Manish — 29.08.05 @ 12:23

  35. Hi,

    I’m trying to build with Visual Studio .NET 2003 (but it must be the same cl - it says it’s version 12.00.8804) and I get the following error: “fatal error C1601: unsupported inline assembly opcode” in jpeg/jdapimin.c(508)

    It is mentioned in the mozilla knowledge base however the solution provided there is to install the MS Processor Pack 5 for VC++. However it is for VC6 only (I guess the .net cl should work without it)

    Comment by atleta — 02.09.05 @ 14:22

  36. Hi, the guide has been very helpful thus far I have however run into a problem when it comes to compiling. It complains that it cannot make executables. I obtained the follow from config.log

    onfigure:1152: checking for nsinstall
    configure:2151: checking for gcc
    configure:2264: checking whether the C compiler (cl ) works
    configure:2280: cl -o conftest conftest.c 1>&5
    Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40310.39 for IA-64
    Copyright (C) Microsoft Corporation. All rights reserved.

    cl : Command line warning D9035 : option ‘o’ has been deprecated and will be removed in a future release
    conftest.c
    Microsoft (R) Incremental Linker Version 8.00.40310.39
    Copyright (C) Microsoft Corporation. All rights reserved.

    /out:conftest.exe
    /out:conftest.exe
    conftest.obj
    LINK : error LNK2001: unresolved external symbol mainCRTStartup
    conftest.exe : fatal error LNK1120: 1 unresolved externals
    configure: failed program was:

    #line 2275 “configure”
    #include “confdefs.h”

    main(){return(0);}

    I’m not sure how to get rid of the error. From reading around the net I gather it may be something to do with a dll or a library. I’m not sure though. Help is very much appreciated.

    Comment by Andrew — 04.09.05 @ 12:19

  37. I am wondering if there is a solution to the
    ‘unresolved external _com_issue_error’ problem ..
    I am building on a new WinXP professional
    with only the software recommended installed on it

    /mozz.lib ../../dist/lib/crmf.lib ../../dist/lib/smime3.lib ../../dist/lib/ss
    .lib ../../dist/lib/nss3.lib ../../dist/lib/softokn3.lib ../../dist/lib/xpco
    compat.lib comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.l
    Urlmon.lib version.lib winspool.lib kernel32.lib user32.lib gdi32.lib winmm.l
    wsock32.lib advapi32.lib comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32
    ib oleaut32.lib version.lib winspool.lib gdi32.lib
    LINK : warning LNK4044: unrecognized option ‘/L../../dist/lib/components’; ign
    ed
    Creating library firefox.lib and object firefox.exp
    brwsrcmp.lib(nsIEProfileMigrator.obj) : error LNK2019: unresolved external sym
    l “void __stdcall _com_issue_error(long)” (?_com_issue_error@@YGXJ@Z) referenc
    in function “public: __thiscall _bstr_t::Data_t::Data_t(unsigned short const
    ” (??0Data_t@_bstr_t@@QAE@PBG@Z)
    firefox.exe : fatal error LNK1120: 1 unresolved externals
    make[4]: *** [firefox.exe] Error 96
    make[4]: Leaving directory `/cygdrive/e/moz/mozilla/objdir/browser/app’
    make[3]: *** [libs] Error 2
    make[3]: Leaving directory `/cygdrive/e/moz/mozilla/objdir/browser’
    make[2]: *** [tier_99] Error 2
    make[2]: Leaving directory `/cygdrive/e/moz/mozilla/objdir’
    make[1]: *** [default] Error 2
    make[1]: Leaving directory `/cygdrive/e/moz/mozilla/objdir’
    make: *** [build] Error 2

    [I'll take a guess and say this is because you didn't apply the patch to disable IE migration code, which used stuff not in the freely available SDK. There's yet hope, tho - keep reading for more details...]

    Comment by PrasadK — 05.09.05 @ 20:24

  38. anyone had fixed xpidl.exe crash error:

    error info:
    /cygdrive/c/home/mozilla/build/cygwin-wrapper ../../dist/bin/xpidl.exe -m header
    -w -I/cygdrive/c/home/mozilla/xpcom/base -I../../dist/idl -o _xpidlgen/nsIConso
    leListener /cygdrive/c/home/mozilla/xpcom/base/nsIConsoleListener.idl

    Julian

    [I'm not familiar with the problem which you describe here, unfortunately. I'm going to be updating these instructions sometime within the next month and a half, tho, so check back then and give it another whirl, and we'll work from there.]

    Comment by julian — 02.10.05 @ 20:26

  39. I tried these instructions yesterday and get the same errors noted in these earlier posts:
    Comment by Robert Claypool — 15.08.05 @ 20:35
    Comment by Victor Ronin — 29.08.05 @ 10:41
    Before that I got and resolved a problem with C:\moz\mozilla\nsprpub\config\now.c which does a conditional include of Windows.h. Windows.h and the chain of Windows headers it includes were not installed with the Microsoft Windows SDK. Copying headers I had laying around to
    C:\Program Files\Microsoft.NET\SDK\v1.1\include fixed this problem but the build failed later after
    make[6]: Leaving directory ‘/cydrive/c/moz/mozilla/nsprpub/pr/src/threads’
    rm -f nspr4_s.lib
    lib -NOLOGO -OUT:”nspr4_s.lib”

    make[5]:*** [nspr4_s.lib] Error 5

    [I'm not sure what the problem is, but I'm going to be updating these instructions within the next month or so, so check back then and we'll see what works. The prime reason for the delay is classes, which occupy a good deal of my time until Christmas. Only after that do I think I'll have time to update these instructions.]

    Comment by Susan Tiner — 05.10.05 @ 10:45

  40. I filed
    bugzilla.mozilla.org/show_bug.cgi?id=311738
    on the nspr4_s problem. As i said there http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit helps.

    What I didn’t put there was that the rc command can’t find the winver in my platform sdk\include… or maybe it can find it but just can’t open it. My cl says 13.10.3077 and is currently working fine. rc says version 5.1.2264.1 build 2264
    I deleted the .NET framework and SDK.

    By the way CL works (no) can be a lib problem or a include problem.

    Comment by Robert Claypool — 09.10.05 @ 18:23

  41. Any chance of updating the instructions for the newly released Visual Studio 2005?

    [Soon, but not too soon. Because I really prefer to work from a fully clean slate when testing this stuff, I usually go through the instructions after a complete hard drive backup and wipe, and getting back up and running after one takes a few days that I won't have during term when classes are happening.

    I do look forward to adding instructions on how to work with the code with Visual C++ 2005 Express, however, as it's currently a free download and will remain so until November next year. It's not clear yet whether this will just be useful for having an IDE for coding or whether it will be useful in the build process.]

    Comment by Aaron Leventhal — 29.10.05 @ 23:13

  42. Hello Jeff,

    I currently just got a trunk (debug, dynamically-linked, shared) Firefox build to compile using the free MS Toolkit and your instructions above. I’d love it if we could include some of these instructions in a page in the new DevMo build documentation.
    Here are some notes on what I had to do to get the build to complete.

    1.) Alter the buildsetup.bat file, updating directories, changing the order of PATH, LIB, & INCLUDE, and making it easier to use non-default directories. Here is what my file looks like:

    REM — changes these to whatever the correct paths for your installation are —

    SET HOME=C:\cygwin\home\James
    SET MOZ_TOOLS=C:\moz\moztools
    SET GLIB_PREFIX=C:\moz\vc71
    SET LIBIDL_PREFIX=C:\moz\vc71

    SET PSDK=C:\Program Files\Microsoft Platform SDK
    SET VCTK=C:\Program Files\Microsoft Visual C++ Toolkit 2003
    SET VSDN=C:\Program Files\Microsoft Visual Studio .NET 2003
    SET DNSDK=C:\Program Files\Microsoft.NET\SDK\v1.1
    SET DNFW=C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
    SET MASM=C:\Program Files\masm32 (I moved this after install from C:\masm32)
    SET CYGWIN=C:\cygwin

    REM — set up environmental variables —

    SET PATH=%GLIB_PREFIX%;%GLIB_PREFIX%\bin;%VCTK%\bin;%PSDK%\Bin;%DNSDK%\Bin;%VSDN%\Common7\IDE;%PSDK%\Bin\Win64;%PSDK%\redist\win64;%DNFW%;%MASM%\BIN;%MOZ_TOOLS%\bin;%CYGWIN%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\wbem

    SET INCLUDE=%VCTK%\include;%PSDK%\include;%DNSDK%\include;%VSDN%\Vc7\include;%PSDK%\include\crt;%MASM%\INCLUDE;%PSDK%\include\atl;%PSDK%\include\mfc

    SET LIB=%VCTK%\lib;%PSDK%\Lib;%DNSDK%\Lib;%VSDN%\Vc7\lib;%MASM%\LIB;%PSDK%\Lib\IA64;%PSDK%\Lib\IA64\mfc

    2.) had to set NO_MFC=1 (as in Comment 4)

    3.) When I got the error about not having the file atlthunk.lib, I tried to build it myself as suggested in Comment 10. I installed the relevant PSDK sources and ran ‘nmake /f atl.mak’, but nmake just gave me the same error about atlthunk.lib not being found! I did some web searching, and according to http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=64509, there is a different implementation of ATL (Active Template Library) in the PSDK than in Visual Studio, and the one in Visual Studio doesn’t require atlthunk.lib, which apparently is not available to anyone outisde of Microsoft. So IIUC, we have to either get the atl implementation in Visual Studio or comment out the “#pragma include atlthunk.lib” line of atlbase.h (as in Comment 4), which I did.

    4.) Also, due to a just-fixed bug (https://bugzilla.mozilla.org/show_bug.cgi?id=241528), which you filled, the disable-ie-migrator patch is no longer needed.

    5.) No trouble with midl, cygwin perl, or make 3.80. No need to alter any makefiles (as in end of comment 4). Fortunately, also no error messages about nspr4, “unresolved external symbol”, or missing files (once I got my PATH, LIB, & INCLUDE right).

    6.) Comment 3 does seem to be right about the minium PSDK components that need to be downloaded and installed.

    7.) After mybuild completed, I could run firefox.exe (in objdir\dist\bin), but with plenty of error messages in the backgroup and Firefox soon froze up. I also created an installer, but it doesn’t work.

    [I recently - just for kicks - decided to try building trunk Firefox with the Windows setup I had from when things weren't working. Oddly enough, it worked after only one hiccup! Some combination of changes I'd made to the build setup combined with changes to the Mozilla source code itself made everything work correctly. Unfortunately I don't have time quite yet to update the instructions to get a working build setup due to classes, so the update will have to wait until at least Christmas.

    In response to the information you posted in #3, I also did some searching and came to the same conclusions. It may be editing the platform SDK, but if the change can't possibly make anything else that might be built break, I have no compunctions about recommending it.

    To anyone else interested in this, I think there's enough information in the article and the comments to successfully get a working build environment. The information's fragmented and sometimes misleading, true, but there's enough to do it if you really, really want to do so. I will update this when I have time, but I don't right now, so feel free to comment and discuss things if you need help getting anything working. When I update the page I also intend to split comments out into separate pages to make it easier to get the information without being distracted by large number of comments.

    One last - sorry that I've been a bit slow about approving comments lately; real life has been a real time suck. Anyone who's posted previously should be able to post without delays, tho, so hopefully that'll at least mitigate the problem. I'll try to keep on top of the queue a bit better in the future.]

    Comment by James Napolitano — 09.11.05 @ 4:56

  43. To all those reporting this configure error:

    D:\moz\mozilla>make -f client.mk build
    cd /cygdrive/d/moz/mozilla
    /cygdrive/d/moz/mozilla/configure
    loading cache ./config.cache
    checking host system type… i686-pc-cygwin
    checking target system type… i686-pc-cygwin
    checking build system type… i686-pc-cygwin
    checking for gcc… cl
    checking whether the C compiler (cl ) works… no
    configure: error: installation or configuration problem: C compiler cannot create executables.
    *** Fix above errors and then restart with “make -f client.mk build”
    make: *** [/cygdrive/d/moz/mozilla/Makefile] Error 1

    I had this one too. It was caused by having run the wrong “link” - make sure your PATH variable contains the cygwin/bin *after* your MSVC directory!

    Comment by Amarok — 18.11.05 @ 9:13

  44. Your patch does not work anymore. How about providing a download link for the sources this tutorial works with? CVS seems to be a source of trouble here.

    [The instructions are intended to work with the "latest" code, so I can't provide a link to source downloads. The patch should be readable in a text editor; try manually applying it if you really need to do so. Keep in mind, tho, that the import/export patch is no longer needed, at least on trunk (I haven't tried compiling branch code with my setup), so try without the patch first.]

    Comment by Amarok — 25.11.05 @ 6:55

  45. Hi There,

    Gud start!. Just have a small request: -

    AT THE BOTTOM OF THE BUILD INSTRUCTIONS AND THE MAIN UPDATES AFTER THAT, PLEASE PUT A SENTENCE THAT READS LIKE “TESTED TO BE WORKING FINE AS OF ” AND “LAST UPDATED ON “.

    This shall actually help people like me who visit your site regularly and have to reset their build environment frequently because of windows reinstallations etc…

    (sorry for the caps. just wanted to be noticed.)

    Keep up the good work.

    [I notice everything that's posted because I get emails on moderated and posted comments; the problem is that I don't have a lot of time, and responses to comments are low on the list of priorities. I added Last Updated note to the top of the doc, although it's not going to be very helpful yet. Look for a real update around Christmas or so.]

    Comment by Varun — 26.11.05 @ 0:40

  46. Build Guide for SeaMonkey and Visual C++ 2005 Express:
    http://jak-software.org/html/en/seamonkey/build/build2/

    Comment by JAK-Software.org — 11.12.05 @ 15:35

  47. Hi

    Response to
    Comment by Robert Claypool — 15.08.05 @ 20:35
    Comment by Victor Ronin — 29.08.05 @ 10:41

    I too had the problem with the lib.exe returning error 5.
    I have VC6 installed (but use free compiler as in the example) and noticed that if I ran vcvars.bat and lib.exe manually (copy & pasting arguments) it worked.
    With the described setup it seems like masm32\bin\lib.exe is used. So I
    1 Renamed lib.exe in that directory (…masm32\bin\lib.exe -> …\masm32\bin\lib.exe.old)
    2 Created a bat file …masm32\bin\lib.bat containing
    echo libscript
    call “c:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT”
    lib %*
    3 Started a cygwin. cd to …masm32\bin\
    ln -s lib.bat lib

    And rerun the make.

    At least it compiled longer this time.

    Best regards,
    Marcus

    Comment by Marcus Engene — 19.12.05 @ 9:23

  48. First of all: great guide! I used it to get started about six months ago, and there’ve been very few problems since then. However, because of several recent changes, there are a few things that could be updated. I’ll list them here.

    As per the fix for bug 241528, you actually can build the IE profile migrator now.
    In your build script, cygwin\bin must precede WINDOWS\system32 because cygwin’s find.exe has to override the one in system32. Otherwise, the build won’t package properly and, because of a recent checkin, actually break when it tries to package extensions like inspector and reporter.
    I’ve honestly never had problems with an objdir build (under the “Cons” section, you noted that such a thing might cause trouble), but if you want to keep the warning I guess that’s fine…

    [Ooh, thanks for letting me know about the second one! I last did a compile several weeks ago and just tried yesterday to get an error which is probably a result of that, so you've saved me some effort on resolving that (assuming it works; I haven't restarted the build to see). The way I currently have the path set up in what I'm using on my machine (which might not match what's here exactly because I haven't had a chance to test everything here recently) means that doing this could cause cygwin's perl to override the ActiveState perl, so I still will need to resolve that before I re-publish the instructions. As for the third, it was reputedly fixed quite a while back, and as I only rarely update these instructions (almost always when I can personally test that it all works) it's hung around a while. The first I may or may not have mentioned in a recent comment; look back and see ;-).]

    Comment by Philip — 08.01.06 @ 13:10

  49. Update on the status of tweaking the instructions again so they work correctly without fiddling:

    Regarding an instructions update to make everything work on a vanilla box, it didn’t happen over Christmastime; it will happen sometime in the next month.

    Comment by Jeff — 10.01.06 @ 11:04

  50. Just to let you know, very recently work has been done to make MSVC v8 (2005) the default Windows compiler on the trunk, and Vlad has significantly updated the MDC Windows build instructions; see http://blog.vlad1.com/archives/2006/02/13/93/. Since the MS Visual C 8 Express Edition is free, I’m going to switch to using that instead of the VC2003 toolkit.

    Comment by James Napolitano — 16.02.06 @ 18:10

  51. I spent about half a day to set up build environments for both 1.8.1 branch and 1.9 trunk on my Win 2k box. The former needs either VC6 or VC7.x while the latter needs VC 7.x or VC8. Because VC6 only works with Feb 2003 edition of PSDK which cannot be installed side by side with the latest PSDK apparently required by VC8 express. I decided to use VC 7 toolkit 2003 for 1.8 branch and VC8 express for trunk. VC8 express part was easy, but VC7 toolkit part was harder. Anyway, thanks to this and other pages, I was able to build both 1.8 and trunk. It might have been easier if I had installed MASM, but I didn’t and had to track down a couple of files, cvtres.exe and lib.exe. I found both cvtres.exe and lib.exe in \Program Files\Microsoft Platform SDK\Bin\win64\x86\AMD (it could be just %PSDKROOT%\Bin\win64, but in my case, it’s in x86/AMD). I confirmed that this lib.exe for 64bit works fine when used to build a 32bit library. It’s also reported that the same is true of cvtres.exe. (for instance, see [http://tinyurl.com/ftqfb here]). However, I picked it up from \WINNT\Microsoft.NET\Framework\v1.1.4322 (.Net Runtime)

    Comment by J. Shin — 26.02.06 @ 1:38

RSS feed for comments on this post. TrackBack URI

Leave a comment


Powered by WordPress. Theme by H P Nadig