Closed Bug 675893 Opened 13 years ago Closed 13 years ago

Link error since new Outlook import code

Categories

(MailNews Core :: Import, defect)

x86_64
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 207156

People

(Reporter: swsnyder, Unassigned)

References

Details

(Keywords: regression)

Attachments

(1 file)

I now get the following link error when building Thunderbird v6.0 Beta 2:

   Creating library xul.lib and object xul.exp
import.lib(rtfDecoder.obj) : error LNK2001: unresolved external symbol "private: static void __cdecl std::locale::facet::facet_Register(class std::locale::facet *)" (?facet_Register@facet@locale@std@@CAXPEAV123@@Z)
xul.dll : fatal error LNK1120: 1 unresolved externals

This problem seems to be a result of the locale-related changes in bug 207156.

My build environment:

WindowsXP/SP2 x86_64 (all updates applied)
VS2008/SP1 (all updates applied)
WindowsSDK v7.1
MozillaBuild v5.1

The same link error is seen with both 32- and 64-bit builds in this environment.  No problems seem when building the TB 5.0 code with the same tools.
Blocks: 207156
Component: Migration → Import
Keywords: regression
Product: Thunderbird → MailNews Core
QA Contact: migration → import
I've also been complaining about this on tb-planning. Since I do not need the Outlook import code in my build, my workaround is to #undef XP_WIN in nsImportModule.cpp
(In reply to comment #1)
> I've also been complaining about this on tb-planning. Since I do not need
> the Outlook import code in my build, my workaround is to #undef XP_WIN in
> nsImportModule.cpp

I don't need it either.

My 1st attempt at a workaround was to simply comment-out the Outlook references in ~/import/build/nsImportModule.cpp and ~/import/Makefile.in as I figured that would be the least intrusive.  It works until you get to the 2nd Import dialog box, where it crashes TB with an apparent null pointer.

Second attempt: removing the "-NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd" results in a successful link, but I'm concerned that it also preempts some or all of the mozcrt19 and/or mozcpp19 libraries referenced later on the command line.

Third attempt: restore the original command line, and append "msvcprt.lib" to it.  This also works and presumably the mozcrt19 and/or mozcpp19 libraries referenced earlier are used to satisfy the external references other than facet_Register().

I also want to the note that the version of MozillaBuild that I'm using is really v1.5.1, not what my fat fingers typed above.  Sigh.
Works around the link failure by providing the missing symbol.

Should not be considered a final fix because the added library references may bloat the executable by pulling in extraneous code.

Patches cleanly against the Thunderbird 6.0 Beta 2 tarball.
It's strange that you see this error.

David had already fixed this in may (see https://bugzilla.mozilla.org/show_bug.cgi?id=207156#c156). Maybe his changes got reverted? But the source code (http://mxr.mozilla.org/comm-central/source/mailnews/import/outlook/src/) seems to be free of any std::locale traces...
I may not have applied the patch to TB 6 - it might just be on the trunk (and probably TB 7 branch).
(In reply to comment #5)
> I may not have applied the patch to TB 6 - it might just be on the trunk
> (and probably TB 7 branch).

From the TB 6.0 Beta 2 tarball (29 Jul 2011):

$ grep -r 'std::locale' mailnews/import/
mailnews/import/outlook/src/rtfDecoder.cpp:  if (std::isalpha(ch, std::locale::classic())) {
mailnews/import/outlook/src/rtfDecoder.cpp:    } while (!stream.get(ch).eof() && std::isalpha(ch, std::locale::classic()));
mailnews/import/outlook/src/rtfDecoder.cpp:    if (!stream.eof() && (std::isdigit(ch, std::locale::classic()) || (ch == '-'))) { // Value begin
mailnews/import/outlook/src/rtfDecoder.cpp:      while (!stream.eof() && std::isdigit(ch, std::locale::classic())) {
mailnews/import/outlook/src/rtfDecoder.cpp:    if (!stream.eof() && !std::isspace(ch, std::locale::classic()))
yeah, so this patch will fix it for you - https://bug207156.bugzilla.mozilla.org/attachment.cgi?id=534752.

I don't know that we want to land this for TB 6, but I'll make the request.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: