Closed Bug 942217 Opened 11 years ago Closed 11 years ago

Adding a new file to content/base/src/moz.build causes build to fail.

Categories

(Firefox Build System :: General, defect)

x86
Windows 7
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
mozilla28

People

(Reporter: wchen, Assigned: wchen)

References

Details

Attachments

(2 files)

The build fails on windows (works fine on mac and linux) if a new file is added to content/base/src/moz.build

Unified_cpp_content_base_src3.obj : error LNK2019: unresolved external symbol "public: static enum tag_nsresult __cdecl nsContentUtils::LoadImageW(class nsIURI *,class nsIDocument *,class nsIPrincipal *,class nsIURI *,class imgINotificationObserver *,int,class imgRequestProxy * *)" (?LoadImageW@nsContentUtils@@SA?AW4tag_nsresult@@PAVnsIURI@@PAVnsIDocument@@PAVnsIPrincipal@@0PAVimgINotificationObserver@@HPAPAVimgRequestProxy@@@Z) referenced in function "protected: enum tag_nsresult __thiscall nsImageLoadingContent::LoadImageW(class nsIURI *,bool,bool,class nsIDocument *,unsigned int)" (?LoadImageW@nsImageLoadingContent@@IAE?AW4tag_nsresult@@PAVnsIURI@@_N1PAVnsIDocument@@I@Z)

Unified_cpp_content_html_content_src1.obj : error LNK2019: unresolved external symbol "protected: enum tag_nsresult __thiscall nsImageLoadingContent::LoadImage(class nsAString_internal const &,bool,bool)" (?LoadImage@nsImageLoadingContent@@IAE?AW4tag_nsresult@@ABVnsAString_internal@@_N1@Z) referenced in function "protected: virtual enum tag_nsresult __thiscall mozilla::dom::HTMLImageElement::AfterSetAttr(int,class nsIAtom *,class nsAttrValue const *,bool)" (?AfterSetAttr@HTMLImageElement@dom@mozilla@@MAE?AW4tag_nsresult@@HPAVnsIAtom@@PBVnsAttrValue@@_N@Z)

Unified_cpp_content_svg_content_src3.obj : error LNK2001: unresolved external symbol "protected: enum tag_nsresult __thiscall nsImageLoadingContent::LoadImage(class nsAString_internal const &,bool,bool)" (?LoadImage@nsImageLoadingContent@@IAE?AW4tag_nsresult@@ABVnsAString_internal@@_N1@Z)

Unified_cpp_content_svg_content_src4.obj : error LNK2001: unresolved external symbol "protected: enum tag_nsresult __thiscall nsImageLoadingContent::LoadImage(class nsAString_internal const &,bool,bool)" (?LoadImage@nsImageLoadingContent@@IAE?AW4tag_nsresult@@ABVnsAString_internal@@_N1@Z)

Here is a try run with a minimized change set that causes this to happen: https://tbpl.mozilla.org/?tree=Try&rev=befc63582636

I was able to get the build working again by moving nsImageLoadingContent.cpp out of UNIFIED_SOURCES in moz.build, but I'm not sure why this fixes the problem (or why the build fails in the first place).

I suspect this is related to switching over to unified sources because it only started happening after the switch.
(In reply to :Ehsan Akhgari (needinfo? me!) from comment #2)
> Can you try adding #undef LoadImage here
> <http://dxr.mozilla.org/mozilla-central/source/content/base/public/
> nsContentUtils.h#30> and here
> <http://dxr.mozilla.org/mozilla-central/source/content/base/src/
> nsImageLoadingContent.cpp#51>?

That fixes the problem.
Flags: needinfo?(wchen)
I'm not sure if we a better idea about how to fix this problem in general but can we at least get this patch in for now so that I can land stuff in the meantime? Thanks for pointing out the issue so quickly.
Attachment #8337036 - Flags: review?(ehsan)
Comment on attachment 8337036 [details] [diff] [review]
Undefine LoadImage to prevent naming conflict on Windows.

Review of attachment 8337036 [details] [diff] [review]:
-----------------------------------------------------------------

Technically the #ifdef's here are not needed, but I don't care much.
Attachment #8337036 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/51097a104f9b
Assignee: nobody → wchen
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: