Microsoft Visual C++ toolkit build instructions

Discussion of third-party/unofficial Firefox/Thunderbird/SeaMonkey builds.
Post Reply
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Nearly got there (I think)...

Code: Select all

Creating Resource file: module.res
/cygdrive/c/mozilla/build/cygwin-wrapper rc.exe  -DMOZ_PHOENIX -I/cygdrive/c/moz
illa/browser/app -DMOZ_STATIC_BUILD -r -DAB_CD=en-US -DMOZILLA_INTERNAL_API -D_I
MPL_NS_GFX -D_IMPL_NS_MSG_BASE -D_IMPL_NS_WIDGET  -DOSTYPE=\"WINNT5.1\" -DOSARCH
=\"WINNT\" -DBUILD_ID=0000000000 -D_BUILD_STATIC_BIN=1 -DFIREFOX_ICO=\"../../dis
t/branding/firefox.ico\" -DDOCUMENT_ICO=\"../../dist/branding/document.ico\" -DA
PP_VERSION="1.0+" -I/cygdrive/c/mozilla/toolkit/xre -I/cygdrive/c/mozilla/config
 -I../../dist/include/xpcom -I../../dist/include/xpcom -I../../dist/include/stri
ng -I../../dist/include -I../../dist/include -I../../dist/include/nspr    -Fomod
ule.res /cygdrive/c/mozilla/browser/app/module.rc
/cygdrive/c/mozilla/build/cygwin-wrapper link -NOLOGO -OUT:firefox.exe -PDB:fire
fox.pdb -SUBSYSTEM:WINDOWS    /HEAP:0x40000 nsBrowserApp.obj nsStaticComponents.
obj ./module.res -L../../dist/lib/components  ../../dist/lib/xulapp_s.lib ../../
dist/lib/js3250.lib ../../dist/lib/xpcom.lib ../../dist/lib/xpcom_core.lib ../..
/dist/lib/nspr4.lib ../../dist/lib/plc4.lib ../../dist/lib/plds4.lib    ../../di
st/lib/components/xpcom_compat_c.lib ../../dist/lib/components/xpc3250.lib ../..
/dist/lib/components/xpctest.lib ../../dist/lib/components/uconv.lib ../../dist/
lib/components/ucvmath.lib ../../dist/lib/components/i18n.lib ../../dist/lib/com
ponents/intlcmpt.lib ../../dist/lib/components/necko.lib ../../dist/lib/componen
ts/necko2.lib ../../dist/lib/components/xppref32.lib ../../dist/lib/components/c
aps.lib ../../dist/lib/components/rdf.lib ../../dist/lib/components/gkparser.lib
 ../../dist/lib/components/gkgfxwin.lib ../../dist/lib/components/imgicon.lib ..
/../dist/lib/components/imglib2.lib ../../dist/lib/components/gkplugin.lib ../..
/dist/lib/components/gkwidget.lib ../../dist/lib/components/gklayout.lib ../../d
ist/lib/components/docshell.lib ../../dist/lib/components/embedcomponents.lib ..
/../dist/lib/components/webbrwsr.lib ../../dist/lib/components/editor.lib ../../
dist/lib/components/txmgr.lib ../../dist/lib/components/composer.lib ../../dist/
lib/components/appshell.lib ../../dist/lib/components/oji.lib ../../dist/lib/com
ponents/accessibility.lib ../../dist/lib/components/chrome.lib ../../dist/lib/co
mponents/mork.lib ../../dist/lib/components/mozfind.lib ../../dist/lib/component
s/appcomps.lib ../../dist/lib/components/cmdlines.lib ../../dist/lib/components/
tkitcmps.lib ../../dist/lib/components/pipboot.lib ../../dist/lib/components/pip
nss.lib ../../dist/lib/components/pippki.lib ../../dist/lib/components/cookie.li
b ../../dist/lib/components/xmlextras.lib ../../dist/lib/components/autoconfig.l
ib ../../dist/lib/components/transformiix.lib ../../dist/lib/components/universa
lchardet.lib ../../dist/lib/components/wsprxtst.lib ../../dist/lib/components/we
bsrvcs.lib ../../dist/lib/components/negotiateauth.lib ../../dist/lib/components
/perms.lib ../../dist/lib/components/srchsvc.lib ../../dist/lib/components/brows
erdirprovider.lib ../../dist/lib/components/brwsrcmp.lib ../../dist/lib/unicharu
til_s.lib ../../dist/lib/ucvutil_s.lib ../../dist/lib/gfxshared_s.lib ../../dist
/lib/gkgfx.lib ../../dist/lib/jsj3250.lib ../../dist/lib/xulapp_s.lib  ../../dis
t/lib/png.lib ../../dist/lib/jpeg3250.lib ../../dist/lib/mozz.lib  ../../dist/li
b/crmf.lib ../../dist/lib/smime3.lib ../../dist/lib/ssl3.lib ../../dist/lib/nss3
.lib ../../dist/lib/softokn3.lib   ../../dist/lib/xpcom_compat.lib comctl32.lib
comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib Urlmon.lib version.lib
winspool.lib kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.li
b comctl32.lib comdlg32.lib uuid.lib shell32.lib ole32.lib oleaut32.lib version.
lib winspool.lib gdi32.lib
LINK : warning LNK4044: unrecognized option '/L../../dist/lib/components'; ignor
ed
   Creating library firefox.lib and object firefox.exp
brwsrcmp.lib(nsIEProfileMigrator.obj) : error LNK2019: unresolved external symbo
l "void __stdcall _com_issue_error(long)" (?_com_issue_error@@YGXJ@Z) referenced
 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/c/mozilla/browser/app'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/cygdrive/c/mozilla/browser'
make[2]: *** [tier_99] Error 2
make[2]: Leaving directory `/cygdrive/c/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/cygdrive/c/mozilla'
make: *** [build] Error 2

(This is with the PSDK linked above which turned out to install fine in the end). So close but yet so far...

[Edit: Is this the migrator issue mentioned in the FAQ? I can't believe that's still there!]
mmoy
Posts: 5030
Joined: February 17th, 2004, 9:05 pm
Location: New Hampshire
Contact:

Post by mmoy »

A note on the internet indicated that this was in vccomsup.lib which is on the Windows Driver Development Kit and you need to have an MSDN subscription to get this file. So I'd disable the profile migrator unless you have access to MSDN via work or via Microsoft Academic Alliance.

But this is really great news as now folks can get the benefits of Microsoft's latest compilers without the messy rules in VS2005 Beta. I will need to check the licensing rules on the PSDK again just to be sure that everything is cool with it.
Dell E521 X2 5600+ MacBookPro 17'' 2.5 Ghz Penryn Dell M1330 2.0 Ghz Merom 4 GB Vista x64 Compaq r3000z AMD 64 3200+ (Win 32/64) PowerMac G5 1.8 Ghz MMOY-1.5 (OSX 10) Inspiron 8500, 4100, 4000, Dimension 2300 MacBook Pro 2.2 Ghz HP E6600 HP X2 4400+
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Well, I'm just doing this for working on patches (in theory, assuming I can understand any of it), so this'll do nicely for me. Thanks for the info.

[Edit: I hacked out some migration code, let's see if this works now]
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Yup, that's got it. Thanks everyone.
User avatar
Sephirot
Posts: 247
Joined: June 15th, 2004, 7:56 am

New patches for IE profile migartion problem

Post by Sephirot »

I've made new patches for current MOZILLA_1_8_BRANCH and TRUNK trees.

In order to build Firefox with IE profile migration you'll need to specify an env var called DDKLIB_PREFIX which has to point to the folder which contains the vccomsub.lib. If it's not set, the IE profile migration stuff won't be included.

#241528

mmoy, the windows DDK CD can be orderd for free -> http://www.microsoft.com/whdc/DevTools/ddk/default.mspx
Author of Bookmarks Menu Button, Autoclose Bookmark&History Folders and more

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.19pre) Gecko/20110701 Firefox/3.6.19pre <-- build with MS VC++ 2010 SP1 and PGO on Win 7 x64
Portero
Posts: 6
Joined: January 1st, 2006, 3:41 pm

Post by Portero »

I am trying to build, but the LINK errors just won't stop.

I use windows xp sp 2.

These are the errors:

Code: Select all

/cygdrive/c/mozilla/nsprpub/build/cygwin-wrapper cl  now.obj   -Fenow.exe
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
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__fprintf referenced in
 function _main
now.obj : error LNK2019: unresolved external symbol __imp___iob referenced in fu
nction _main
now.obj : error LNK2019: unresolved external symbol __imp__GetSystemTimeAsFileTi
me@4 referenced in function _main
now.obj : error LNK2019: unresolved external symbol __alldiv referenced in funct
ion _main
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
now.exe : fatal error LNK1120: 5 unresolved externals
make[4]: *** [now.exe] Error 2
make[4]: Leaving directory `/cygdrive/c/mozilla/nsprpub/config'
make[3]: *** [export] Error 2
make[3]: Leaving directory `/cygdrive/c/mozilla/nsprpub'
make[2]: *** [nspr] Error 2
make[2]: Leaving directory `/cygdrive/c/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/cygdrive/c/mozilla'
make: *** [build] Error 2



Are these correct?

Code: Select all

set MOZ_TOOLS=C:\moztools
set HOME=C:\Home
set CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot

set PATH=c:\vc71/bin;C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;c:\Program files\Microsoft Platform SDK\Bin;C:\Program Files\Microsoft.NET\SDK\v1.1\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\moztools\bin;c:\cygwin\bin;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;C:\Program Files\Microsoft Platform SDK\Bin\win64;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;c:\masm32\bin;%path%

set 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:\Program Files\Microsoft Platform SDK\Lib\IA64;C:\Program Files\Microsoft Platform SDK\Lib\IA64\mfc;C:\Program Files\Microsoft Platform SDK\Lib\IA64;C:\Program Files\Microsoft Visual C++ Toolkit 2003\include%lib%

set INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;c:\Program Files\Microsoft Platform SDK\Include;c:\Program Files\Microsoft.NET\SDK\v1.1\include;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include;c:\Program Files\Microsoft Platform SDK\include\atl;c:\Program Files\Microsoft SDK\include\mfc;c:\Program Files\Microsoft SDK\include\crt;c:\Program Files\Microsoft SDK\include\gl;c:\masm32\include;%include%
User avatar
mahowi
Posts: 569
Joined: September 16th, 2005, 12:37 pm
Location: Germany
Contact:

Post by mahowi »

The libs with the "unresolved external symbols" are in c:\program files\Microsoft Platform SDK\lib and C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib. So this should normally not happen.

"set PATH=c:\vc71/bin;..." should be "set PATH=c:\vc71\bin;..."

"C:\Program Files\Microsoft Visual C++ Toolkit 2003\include" isn't needed in LIB. There's also a ";" missing between this and "%lib%.

Here is my buildsetup.bat.
Firefox: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052316 Firefox/3.0pre (mahowi) ID:2008052316
Thunderbird: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052904 Thunderbird/3.0a2pre ID:2008052904
Portero
Posts: 6
Joined: January 1st, 2006, 3:41 pm

Post by Portero »

Wow that's an extensive one. I also checked your mozconfig, I will certainly make use of it when I get this thing to compile correctly.

At the moment I get an other error message:

Code: Select all

lib -NOLOGO -OUT:"xpcomglue.lib"  pldhash.obj nsCOMPtr.obj nsComponentManagerUti
ls.obj nsDebug.obj nsID.obj nsIInterfaceRequestorUtils.obj nsINIParser.obj nsMem
ory.obj nsTraceRefcnt.obj nsWeakReference.obj nsGREGlue.obj nsVersionComparator.
obj nsTHashtable.obj nsXPCOMGlue.obj nsGREDirServiceProvider.obj nsGlueLinkingWi
n.obj
make[5]: *** [xpcomglue.lib] Error 5
make[5]: Leaving directory `/cygdrive/c/mozilla/xpcom/glue/standalone'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/cygdrive/c/mozilla/xpcom/glue'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/cygdrive/c/mozilla/xpcom'
make[2]: *** [tier_2] Error 2
make[2]: Leaving directory `/cygdrive/c/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/cygdrive/c/mozilla'
make: *** [build] Error 2


Any ideas?
cycloid
Posts: 30
Joined: March 13th, 2004, 5:49 pm

Post by cycloid »

It worked! got a build going some of the issues i encountered are in other threads but here are some notes (win xp2)

first i started with TierMann's firefox build instructions here

install cygwin's perl - i had activestate and it just wouldnt go!

instead of applying the IE patch just manually declare this in nsIEProfileMigrator.cpp: void __stdcall _com_issue_error(HRESULT hr){}

some files are "missing" from the vc++ toolkit, namely lib.exe and supporting dlls, these can, bizzarely be snatched from the platform sdk's 64bit bin directory - place them in your Visual C++ Toolkit "bin" folder

i installed the "platform sdk" and not the "microsoft sdk" so the paths in my bat file were wrong (caused XPCOM error for a start)

download the msvcprt.lib from here - place them in your Visual C++ Toolkit "lib" folder

my mozconfig (it goes in your mozilla dir, the one where you run make!)

Code: Select all

. $topsrcdir/browser/config/mozconfig

ac_add_options --disable-shared
ac_add_options --enable-static
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
ac_add_options --enable-crypto


and my "setup.bat" aka "mozset.bat"

Code: Select all

@echo off
set MOZ_TOOLS=C:\moztools
set HOME=C:\mozilla
set CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
set GLIB_PREFIX=C:\vc71
set LIBIDL_PREFIX=c:\vc71

set PATH=c:\vc71\bin;
C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;
c:\Program files\Microsoft Platform SDK\bin;
C:\Program Files\Microsoft.NET\SDK\v1.1\Bin;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
c:\moztools\bin;
c:\cygwin\bin;
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE;
C:\Program Files\Microsoft Platform SDK\Bin\Win64;
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;
c:\masm32\bin;
%path%

set 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:\Program Files\Microsoft Platform SDK\Lib\IA64;
C:\Program Files\Microsoft Platform SDK\Lib\IA64\mfc;
%lib%

set INCLUDE=C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;
c:\Program Files\Microsoft Platform SDK\Include;
c:\Program Files\Microsoft.NET\SDK\v1.1\include;
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include;
C:\Program Files\Microsoft Platform SDK\include\crt;
C:\Program Files\Microsoft Platform SDK\Include\atl;
c:\masm32\include;
%include%
User avatar
mahowi
Posts: 569
Joined: September 16th, 2005, 12:37 pm
Location: Germany
Contact:

Post by mahowi »

There's a newer version of the Platform SDK available: Windows® Server 2003 R2 Platform SDK
Firefox: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052316 Firefox/3.0pre (mahowi) ID:2008052316
Thunderbird: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052904 Thunderbird/3.0a2pre ID:2008052904
User avatar
Sephirot
Posts: 247
Joined: June 15th, 2004, 7:56 am

Post by Sephirot »

mahowi wrote:There's a newer version of the Platform SDK available: Windows® Server 2003 R2 Platform SDK
Do you use this one already?
Author of Bookmarks Menu Button, Autoclose Bookmark&History Folders and more

Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.19pre) Gecko/20110701 Firefox/3.6.19pre <-- build with MS VC++ 2010 SP1 and PGO on Win 7 x64
User avatar
mahowi
Posts: 569
Joined: September 16th, 2005, 12:37 pm
Location: Germany
Contact:

Post by mahowi »

Yes. No problems so far.
Firefox: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052316 Firefox/3.0pre (mahowi) ID:2008052316
Thunderbird: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008052904 Thunderbird/3.0a2pre ID:2008052904
User avatar
Toad King
Posts: 65
Joined: January 12th, 2005, 12:44 pm
Contact:

Post by Toad King »

I'm using the new Windows SDK as well with no problems. This is while using it's build-in SetEnv.Cmd script.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.4) Gecko/20060617 Firefox/1.5.0.4 - Build ID: 2006061719
diaa
Posts: 25
Joined: December 20th, 2005, 6:10 am

Post by diaa »

I made a tutorial about this, you can find it at http://www.thunderbird-software.com/blo ... lkit-2003/
hope it helps.
User avatar
BenBasson
Moderator
Posts: 13671
Joined: February 13th, 2004, 5:49 am
Location: London, UK
Contact:

Post by BenBasson »

Looks a lot simpler than it used to be. Thanks for the tutorial!
Post Reply