Closed Bug 316122 Opened 19 years ago Closed 16 years ago

Fix Outlook Express import to work with MS VC++ 2005

Categories

(Thunderbird :: Build Config, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: ronny.perinke, Unassigned)

Details

(Whiteboard: CLOSEME 2008-05-29)

Attachments

(1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8) Gecko/20051111 Firefox/1.5 (Sephiroth/AXP)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8) Gecko/20051111 Firefox/1.5 (Sephiroth/AXP)

building Thunderbird with MS VC++ 2005 will fail while processing the OUtlook Express (OE) mail and addressbook import stuff.

c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\wabdefs.h(76) : error C2371: 'WCHAR' : redefinition; different basic types
c:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\winnt.h(266) : see declaration of 'WCHAR'


wabdefs.h
----------
#if !defined(UNIX) && !defined(WIN16)
typedef WORD                WCHAR;


winnt.h
--------
#ifndef _MAC
typedef wchar_t WCHAR;    // wc,   16-bit UNICODE character
#else
// some Macintosh compilers don't define wchar_t in a convenient location, or define it as a char
typedef unsigned short WCHAR;    // wc,   16-bit UNICODE character
#endif
#endif

Reproducible: Always

Steps to Reproduce:
1. build Thunderbird with MS VC++ 2005
2.
3.
Version: unspecified → 1.5
I think I found a _workaround_

There was nor problem with MSVC++ 2003 because it did not used /Zc:wchar_t by default, but MSVC++ 2005 enables /Zc:wchar_t by default!

To build it with MSVC++ 2005 the switch /Zc:wchar_t- should be used or the code needs some changes.
now the build process fails to create thunderbird.exe - I'm getting erros about unresolved external symbols

make[6]: Leaving directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail/themes/qute/mail'
make[5]: Leaving directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail/themes/qute'
make[4]: Leaving directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail/themes'
make[4]: Entering directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail/app'
/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/config/static-rules.mk:8: FINAL_LINK_COMP_NAMES = ../../config/final-link-comp-names
/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/config/static-rules.mk:9: FINAL_LINK_COMPS = ../../config/final-link-comps
nsMailApp.cpp
/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/build/cygwin-wrapper cl -FonsMailApp.obj -c  -DTHUNDERBIRD_ICO=\"../../dist/branding/thunderbird.ico\" -DAB_CD=de -DMOZILLA_INTERNAL_API -D_IMPL_NS_GFX -D_IMPL_NS_MSG_BASE -D_IMPL_NS_WIDGET  -DOSTYPE=\"WINNT5.1\" -DOSARCH=\"WINNT\" -DBUILD_ID=0000000000 -D_BUILD_STATIC_BIN=1 -DAPP_VERSION="1.5" -I/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/toolkit/xre -I/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/config -I../../dist/include/xpcom -I../../dist/include/xpcom -I../../dist/include/string -I../../dist/include -I../../dist/include -I../../dist/include/nspr          -TP -nologo -W3 -Gy -FdnsMailApp.pdb  -DNDEBUG -DTRIMMED -O2 -GA -GF -GL -Gs -GT -arch:SSE -MD            -DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ -DX_DISPLAY_MISSING=1 -DMOZILLA_VERSION=\"1.8\" -DMOZILLA_VERSION_U=1.8 -DHAVE_SNPRINTF=1 -D_WINDOWS=1 -D_WIN32=1 -DWIN32=1 -DXP_WIN=1 -DXP_WIN32=1 -DHW_THREADS=1 -DWINVER=0x400 -D_WIN32_WINNT=0x400 -DSTDC_HEADERS=1 -DWIN32_LEAN_AND_MEAN=1 -DNO_X11=1 -D_X86_=1 -DD_INO=d_ino -DMOZ_DEFAULT_TOOLKIT=\"windows\" -DMOZ_THUNDERBIRD=1 -DMOZ_BUILD_APP=mail -DMOZ_XUL_APP=1 -DMOZ_STATIC_MAIL_BUILD=1 -DMOZ_DISTRIBUTION_ID=\"org.mozilla\" -DIBMBIDI=1 -DMOZ_VIEW_SOURCE=1 -DMOZ_XPINSTALL=1 -DMOZ_JSLOADER=1 -DMOZ_XTF=1 -DMOZ_UPDATE_CHANNEL=default -DNS_DISABLE_LOGGING=1 -DMOZ_USER_DIR=\"Mozilla\" -DMOZ_XUL=1 -DMOZ_PROFILELOCKING=1 -DMOZ_DLL_SUFFIX=\".dll\" -DJS_THREADSAFE=1 -DNS_PRINT_PREVIEW=1 -DNS_PRINTING=1 -DMOZILLA_LOCALE_VERSION=\"1.8b5\" -DMOZILLA_REGION_VERSION=\"1.8b5\" -DMOZILLA_SKIN_VERSION=\"1.8\"  /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/mail/app/nsMailApp.cpp
nsMailApp.cpp
rm -f nsStaticComponents.cpp
cat /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/config/nsStaticComponents.cpp.in | \
sed -e "s|%MODULE_LIST%|MODULE(xpcomObsoleteModule) MODULE(xpconnect) MODULE(nsUConvModule) MODULE(nsI18nModule) MODULE(I18nCompatibility) MODULE(necko_core_and_primary_protocols) MODULE(necko_secondary_protocols) MODULE(nsJarModule) MODULE(nsPrefModule) MODULE(nsSecurityManagerModule) MODULE(nsRDFModule) MODULE(nsParserModule) MODULE(nsGfxModule) MODULE(nsIconDecoderModule) MODULE(nsImageLib2Module) MODULE(nsWidgetModule) MODULE(nsLayoutModule) MODULE(docshell_provider) MODULE(embedcomponents) MODULE(Browser_Embedding_Module) MODULE(nsEditorModule) MODULE(nsTransactionManagerModule) MODULE(nsComposerModule) MODULE(appshell) MODULE(nsChromeModule) MODULE(nsMorkModule) MODULE(nsFindComponent) MODULE(application) MODULE(CommandLineModule) MODULE(nsToolkitCompsModule) MODULE(Apprunner) MODULE(BOOT) MODULE(NSS) MODULE(PKI) MODULE(nsLDAPProtocolModule) MODULE(nsWalletModule) MODULE(nsWalletViewerModule) MODULE(nsXMLExtrasModule) MODULE(nsAutoConfigModule) MODULE(nsWebServicesModule) MODULE(nsUniversalCharDetModule) MODULE(nsAuthModule) MODULE(nsImportServiceModule) MODULE(nsMsgSMIMEModule) MODULE(msgMapiModule) MODULE(nsMailModule) MODULE(nsMailCompsModule)|" \
> nsStaticComponents.cpp
nsStaticComponents.cpp
/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/build/cygwin-wrapper cl -FonsStaticComponents.obj -c  -DTHUNDERBIRD_ICO=\"../../dist/branding/thunderbird.ico\" -DAB_CD=de -DMOZILLA_INTERNAL_API -D_IMPL_NS_GFX -D_IMPL_NS_MSG_BASE -D_IMPL_NS_WIDGET  -DOSTYPE=\"WINNT5.1\" -DOSARCH=\"WINNT\" -DBUILD_ID=0000000000 -D_BUILD_STATIC_BIN=1 -DAPP_VERSION="1.5" -I/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/toolkit/xre -I/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/config -I../../dist/include/xpcom -I../../dist/include/xpcom -I../../dist/include/string -I../../dist/include -I../../dist/include -I../../dist/include/nspr          -TP -nologo -W3 -Gy -FdnsStaticComponents.pdb  -DNDEBUG -DTRIMMED -O2 -GA -GF -GL -Gs -GT -arch:SSE -MD            -DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ -DX_DISPLAY_MISSING=1 -DMOZILLA_VERSION=\"1.8\" -DMOZILLA_VERSION_U=1.8 -DHAVE_SNPRINTF=1 -D_WINDOWS=1 -D_WIN32=1 -DWIN32=1 -DXP_WIN=1 -DXP_WIN32=1 -DHW_THREADS=1 -DWINVER=0x400 -D_WIN32_WINNT=0x400 -DSTDC_HEADERS=1 -DWIN32_LEAN_AND_MEAN=1 -DNO_X11=1 -D_X86_=1 -DD_INO=d_ino -DMOZ_DEFAULT_TOOLKIT=\"windows\" -DMOZ_THUNDERBIRD=1 -DMOZ_BUILD_APP=mail -DMOZ_XUL_APP=1 -DMOZ_STATIC_MAIL_BUILD=1 -DMOZ_DISTRIBUTION_ID=\"org.mozilla\" -DIBMBIDI=1 -DMOZ_VIEW_SOURCE=1 -DMOZ_XPINSTALL=1 -DMOZ_JSLOADER=1 -DMOZ_XTF=1 -DMOZ_UPDATE_CHANNEL=default -DNS_DISABLE_LOGGING=1 -DMOZ_USER_DIR=\"Mozilla\" -DMOZ_XUL=1 -DMOZ_PROFILELOCKING=1 -DMOZ_DLL_SUFFIX=\".dll\" -DJS_THREADSAFE=1 -DNS_PRINT_PREVIEW=1 -DNS_PRINTING=1 -DMOZILLA_LOCALE_VERSION=\"1.8b5\" -DMOZILLA_REGION_VERSION=\"1.8b5\" -DMOZILLA_SKIN_VERSION=\"1.8\"  /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail/app/nsStaticComponents.cpp
nsStaticComponents.cpp
/usr/bin/perl /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/config/version_win.pl -QUIET 1 -DEPTH ../.. -TOPSRCDIR /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla -BITS 32 -OBJDIR . -SRCDIR /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/mail/app -DISPNAME Thunderbird -BINARY thunderbird.exe -RCINCLUDE /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/mail/app/splash.rc
Creating Resource file: module.res
/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/build/cygwin-wrapper rc.exe  -DMOZ_THUNDERBIRD -I/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/mail/app -DMOZ_STATIC_BUILD -r -DTHUNDERBIRD_ICO=\"../../dist/branding/thunderbird.ico\" -DAB_CD=de -DMOZILLA_INTERNAL_API -D_IMPL_NS_GFX -D_IMPL_NS_MSG_BASE -D_IMPL_NS_WIDGET  -DOSTYPE=\"WINNT5.1\" -DOSARCH=\"WINNT\" -DBUILD_ID=0000000000 -D_BUILD_STATIC_BIN=1 -DAPP_VERSION="1.5" -I/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/toolkit/xre -I/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/config -I../../dist/include/xpcom -I../../dist/include/xpcom -I../../dist/include/string -I../../dist/include -I../../dist/include -I../../dist/include/nspr    -Fomodule.res /cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail/app/module.rc
/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/mozilla/build/cygwin-wrapper link -NOLOGO -OUT:thunderbird.exe -PDB:thunderbird.pdb -SUBSYSTEM:WINDOWS -ltcg  -opt:ref,icf,nowin98 /HEAP:0x40000 nsMailApp.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    ../../dist/lib/components/xpcom_compat_c.lib ../../dist/lib/components/xpc3250.lib ../../dist/lib/components/uconv.lib ../../dist/lib/components/i18n.lib ../../dist/lib/components/intlcmpt.lib ../../dist/lib/components/necko.lib ../../dist/lib/components/necko2.lib ../../dist/lib/components/jar50.lib ../../dist/lib/components/xppref32.lib ../../dist/lib/components/caps.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/gkwidget.lib ../../dist/lib/components/gklayout.lib ../../dist/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/chrome.lib ../../dist/lib/components/mork.lib ../../dist/lib/components/mozfind.lib ../../dist/lib/components/appcomps.lib ../../dist/lib/components/cmdlines.lib ../../dist/lib/components/tkitcmps.lib ../../dist/lib/components/pipboot.lib ../../dist/lib/components/pipnss.lib ../../dist/lib/components/pippki.lib ../../dist/lib/components/mozldap.lib ../../dist/lib/components/wallet.lib ../../dist/lib/components/wlltvwrs.lib ../../dist/lib/components/xmlextras.lib ../../dist/lib/components/autoconfig.lib ../../dist/lib/components/websrvcs.lib ../../dist/lib/components/universalchardet.lib ../../dist/lib/components/auth.lib ../../dist/lib/components/import.lib ../../dist/lib/components/msgsmime.lib ../../dist/lib/components/msgMapi.lib ../../dist/lib/components/mail.lib ../../dist/lib/components/mailcmp.lib ../../dist/lib/unicharutil_s.lib ../../dist/lib/ucvutil_s.lib ../../dist/lib/gfxshared_s.lib ../../dist/lib/gkgfx.lib ../../dist/lib/xulapp_s.lib ../../dist/lib/mimecthglue_s.lib ../../dist/lib/mozMapi32.lib  ../../dist/lib/png.lib ../../dist/lib/jpeg3250.lib ../../dist/lib/mozz.lib  ../../dist/lib/crmf.lib ../../dist/lib/smime3.lib ../../dist/lib/ssl3.lib ../../dist/lib/nss3.lib ../../dist/lib/softokn3.lib   ../../dist/lib/nsldap32v50.lib ../../dist/lib/nsldappr32v50.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.lib 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'; ignored
   Creating library thunderbird.lib and object thunderbird.exp
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const nsCharTraits<unsigned short>::sEmptyBuffer" (__imp_?sEmptyBuffer@?$nsCharTraits@G@@2PBGB)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned short * __cdecl ToNewUnicode(class nsAString_internal const &)" (__imp_?ToNewUnicode@@YAPAGABVnsAString_internal@@@Z)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall nsSubstring::Replace(unsigned int,unsigned int,unsigned short const *,unsigned int)" (__imp_?Replace@nsSubstring@@QAEXIIPBGI@Z)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall nsSubstring::Adopt(unsigned short *,unsigned int)" (__imp_?Adopt@nsSubstring@@QAEXPAGI@Z)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl nsTextFormatter::smprintf_free(unsigned short *)" (__imp_?smprintf_free@nsTextFormatter@@SAXPAG@Z)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short * __cdecl nsTextFormatter::smprintf(unsigned short const *,...)" (__imp_?smprintf@nsTextFormatter@@SAPAGPBGZZ)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "public: virtual int __thiscall nsCaseInsensitiveStringComparator::operator()(unsigned short const *,unsigned short const *,unsigned int)const " (??RnsCaseInsensitiveStringComparator@@UBEHPBG0I@Z)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "public: virtual int __thiscall nsCaseInsensitiveStringComparator::operator()(unsigned short,unsigned short)const " (??RnsCaseInsensitiveStringComparator@@UBEHGG@Z)
import.lib(nsOEImport.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl nsCRT::free(unsigned short *)" (__imp_?free@nsCRT@@SAXPAG@Z)
import.lib(nsOEStringBundle.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall nsSubstring::Assign(unsigned short const *,unsigned int)" (__imp_?Assign@nsSubstring@@QAEXPBGI@Z)
import.lib(nsOEAddressIterator.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall nsString::ReplaceSubstring(unsigned short const *,unsigned short const *)" (__imp_?ReplaceSubstring@nsString@@QAEXPBG0@Z)
import.lib(nsOEAddressIterator.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall nsString::ReplaceChar(unsigned short,unsigned short)" (__imp_?ReplaceChar@nsString@@QAEXGG@Z)
import.lib(nsOEAddressIterator.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall nsString::RFindChar(unsigned short,int,int)const " (__imp_?RFindChar@nsString@@QBEHGHH@Z)
import.lib(nsOEAddressIterator.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl AppendUTF16toUTF8(unsigned short const *,class nsACString_internal &)" (__imp_?AppendUTF16toUTF8@@YAXPBGAAVnsACString_internal@@@Z)
thunderbird.exe : fatal error LNK1120: 14 unresolved externals
make[4]: *** [thunderbird.exe] Error 96
make[4]: Leaving directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail/app'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8/mail'
make[2]: *** [tier_99] Error 2
make[2]: Leaving directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/cygdrive/l/building_Mozilla/source/BRANCH_1_5_x/thunderbird_vc8'
make: *** [build] Error 2
Ok, now I know that other parts need to be compiled with Zc.wchar_t- too.
I think they are in mail/app.
I thought it was mail/app but I was wrong, the other parts are in mail/components.

This patch should to fix the problem. Another trick instead of the patch, is to add -Zc:wchar_t- to your optimize flags.

mailnews/import/oexpress
mail/components/build
mail/components/migration/src

needs -Zc:wchar_t- flag, if MSVC++ 2005 is used
Attachment #203432 - Flags: review?
Comment on attachment 203432 [details] [diff] [review]
patch to compile oeimport and migration stuff without -Zc:wchar_t for MSVC++ 2005 (VC8)

I've noticed today, that this patch doest not fix the problem :(
But the other trick with adding -Zc:wchar_t- to the enable-optimize flag does work.
Attachment #203432 - Flags: review? → review-
I just ran into this when trying a build so I'm confirming it. I'll test the solution in the morning.
Attachment #203432 - Attachment is obsolete: true
Attachment #203432 - Flags: review-
QA Contact: chase → build
QA Contact: build → build-config
Is this still a problem with the latest trunk? I guess probably not considering trunk is meant to be building on VC 8 (2005).
Assignee: mscott → nobody
Whiteboard: CLOSEME 2008-05-29
No responses, trunk is compiling on VC 8 (2005) therefore closing as WFM.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: