Closed Bug 1187178 Opened 9 years ago Closed 9 years ago

Failed to compile WindowsUIUtils.cpp: error C2011: 'ABI::Windows::UI::ViewManagement::UserInteractionMode': 'enum' type redefinition

Categories

(Core Graveyard :: Widget: WinRT, defect)

x86_64
Windows 10
defect
Not set
normal

Tracking

(firefox43 fixed)

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: xavier114fch, Assigned: m_kato)

References

Details

Attachments

(1 file, 1 obsolete file)

Compiled using VS 2015 RTM and Windows 10 SDK RTM. This error occurs:

 9:00.66 WindowsUIUtils.cpp
 9:00.66 h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp(41): error C2011: 'ABI::Windows::UI::ViewManagement::UserInteractionMode': 'enum' type redefinition
 9:00.66 C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt\windows.ui.viewmanagement.h(2979): note: see declaration of 'ABI::Windows::UI::ViewManagement::UserInteractionMode'
 9:00.66 h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp(63): error C2011: 'ABI::Windows::UI::ViewManagement::IUIViewSettings': 'struct' type redefinition
 9:00.66 h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp(61): note: see declaration of 'ABI::Windows::UI::ViewManagement::IUIViewSettings'
 9:00.66 h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp(69): error C2374: 'ABI::Windows::UI::ViewManagement::IID_IUIViewSettings': redefinition; multiple initialization
 9:00.66 C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt\windows.ui.viewmanagement.h(6731): note: see declaration of 'ABI::Windows::UI::ViewManagement::IID_IUIViewSettings'
 9:00.66 h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp(156): error C2027: use of undefined type 'ABI::Windows::UI::ViewManagement::IUIViewSettings'
 9:00.66 h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp(61): note: see declaration of 'ABI::Windows::UI::ViewManagement::IUIViewSettings'
 9:00.66 h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp(156): error C2039: 'get_UserInteractionMode': is not a member of 'Microsoft::WRL::ComPtr<ABI::Windows::UI::ViewManagement::IUIViewSettings>'
 9:00.66
 9:00.69 In the directory  /h/mozilla-inbound/obj/widget/windows
 9:00.69 The following command failed to execute properly:
 9:00.69 h:/mozilla-inbound/obj/_virtualenv/Scripts/python.exe -m mozbuild.action.cl cl -FoWindowsUIUtils.obj -c -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DOS_WIN=1 -D_UNICODE -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DUNICODE -DNOMINMAX -D_WINDOWS -D_SECURE_ATL -DCOMPILER_MSVC -DMOZ_UNICODE -DSTATIC_EXPORTABLE_JS_API -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DAB_CD=en-US -DNO_NSPR_10_SUPPORT -Ih:/mozilla-inbound/widget/windows -I. -Ih:/mozilla-inbound/obj/ipc/ipdl/_ipdlheaders -Ih:/mozilla-inbound/ipc/chromium/src -Ih:/mozilla-inbound/ipc/glue -Ih:/mozilla-inbound/layout/generic -Ih:/mozilla-inbound/layout/xul -Ih:/mozilla-inbound/toolkit/xre -Ih:/mozilla-inbound/widget -Ih:/mozilla-inbound/xpcom/base -I../../dist/include -Ih:/mozilla-inbound/obj/dist/include/nspr -Ih:/mozilla-inbound/obj/dist/include/nss -MD -FI ../../dist/include/mozilla-config.h -DMOZILLA_CLIENT -TP -nologo -Wv:18 -Zc:sizedDealloc- -wd4091 -D_HAS_EXCEPTIONS=0 -DNOMINMAX -W3 -Gy -FS -wd4251 -wd4244 -wd4267 -wd4345 -wd4351 -wd4482 -wd4800 -wd4819 -we4553 -GR- -DNDEBUG -DTRIMMED -Zi -UDEBUG -DNDEBUG -O1 -Oi -Oy -Ih:/mozilla-inbound/obj/dist/include/cairo -Fdgenerated.pdb h:/mozilla-inbound/widget/windows/WindowsUIUtils.cpp
 9:00.70 h:/mozilla-inbound/config/rules.mk:958: recipe for target 'WindowsUIUtils.obj' failed
 9:00.70 mozmake.EXE[5]: *** [WindowsUIUtils.obj] Error 1
 9:00.70 h:/mozilla-inbound/config/recurse.mk:71: recipe for target 'widget/windows/target' failed
 9:00.71 mozmake.EXE[4]: *** [widget/windows/target] Error 2
 9:00.71 h:/mozilla-inbound/config/recurse.mk:32: recipe for target 'compile' failed
 9:00.71 mozmake.EXE[3]: *** [compile] Error 2
 9:00.71 h:/mozilla-inbound/config/rules.mk:549: recipe for target 'default' failed
 9:00.71 mozmake.EXE[2]: *** [default] Error 2
 9:00.71 h:/mozilla-inbound/client.mk:401: recipe for target 'realbuild' failed
 9:00.71 mozmake.EXE[1]: *** [realbuild] Error 2
 9:00.72 client.mk:171: recipe for target 'build' failed
 9:00.72 mozmake.EXE: *** [build] Error 2
Blocks: VC14
Component: Build Config → Widget: WinRT
Product: Firefox → Core
Target Milestone: --- → mozilla42
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment on attachment 8641826 [details] [diff] [review]
When compiling with VS2015 do not define ViewManagement classes ourselves

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

::: widget/windows/WindowsUIUtils.cpp
@@ +30,5 @@
>  using namespace Microsoft::WRL;
>  using namespace Microsoft::WRL::Wrappers;
>  using namespace ABI::Windows::Foundation;
>  
> +#if _MSC_VER < 1900

Why tie this to the compiler version, it should be tied to the sdk version. The ifndef UserInteractionMode was supposed to catch this but maybe the namespacing is getting in the way. Mind taking a look at that?
IUIViewSettings is defined on Windows 10 SDK only.  Also, as long as I know, current mozilla-build only supports Windows 8.1 SDK.

Bas, we should use "#if MOZ_WINSDK_MAXVER < 0x0a000" instead of _MSC_VER condition.
s/0x0a000/0x0A000000/
Attachment #8641826 - Flags: review?(jmathies) → review-
(In reply to Makoto Kato [:m_kato] from comment #3)
> IUIViewSettings is defined on Windows 10 SDK only.  Also, as long as I know,
> current mozilla-build only supports Windows 8.1 SDK.
> 
> Bas, we should use "#if MOZ_WINSDK_MAXVER < 0x0a000" instead of _MSC_VER
> condition.

Mozilla-build for me seems to use the Win 10 SDK when selecting the VS2015 version.

(In reply to Jim Mathies [:jimm] from comment #2)
> Comment on attachment 8641826 [details] [diff] [review]
> When compiling with VS2015 do not define ViewManagement classes ourselves
> 
> Review of attachment 8641826 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: widget/windows/WindowsUIUtils.cpp
> @@ +30,5 @@
> >  using namespace Microsoft::WRL;
> >  using namespace Microsoft::WRL::Wrappers;
> >  using namespace ABI::Windows::Foundation;
> >  
> > +#if _MSC_VER < 1900
> 
> Why tie this to the compiler version, it should be tied to the sdk version.
> The ifndef UserInteractionMode was supposed to catch this but maybe the
> namespacing is getting in the way. Mind taking a look at that?

I'll have a look tomorrow!
(In reply to Jim Mathies [:jimm] from comment #2)
> Comment on attachment 8641826 [details] [diff] [review]
> When compiling with VS2015 do not define ViewManagement classes ourselves
> 
> Review of attachment 8641826 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: widget/windows/WindowsUIUtils.cpp
> @@ +30,5 @@
> >  using namespace Microsoft::WRL;
> >  using namespace Microsoft::WRL::Wrappers;
> >  using namespace ABI::Windows::Foundation;
> >  
> > +#if _MSC_VER < 1900
> 
> Why tie this to the compiler version, it should be tied to the sdk version.
> The ifndef UserInteractionMode was supposed to catch this but maybe the
> namespacing is getting in the way. Mind taking a look at that?

Does #ifndef even work on regular struct names? I thought it only worked on preprocessor macro's?
(In reply to Bas Schouten (:bas.schouten) from comment #6)
> (In reply to Jim Mathies [:jimm] from comment #2)
> > Comment on attachment 8641826 [details] [diff] [review]
> > When compiling with VS2015 do not define ViewManagement classes ourselves
> > 
> > Review of attachment 8641826 [details] [diff] [review]:
> > -----------------------------------------------------------------
> > 
> > ::: widget/windows/WindowsUIUtils.cpp
> > @@ +30,5 @@
> > >  using namespace Microsoft::WRL;
> > >  using namespace Microsoft::WRL::Wrappers;
> > >  using namespace ABI::Windows::Foundation;
> > >  
> > > +#if _MSC_VER < 1900
> > 
> > Why tie this to the compiler version, it should be tied to the sdk version.
> > The ifndef UserInteractionMode was supposed to catch this but maybe the
> > namespacing is getting in the way. Mind taking a look at that?
> 
> Does #ifndef even work on regular struct names? I thought it only worked on
> preprocessor macro's?

No it doesn.t, but there's probably something #defined in the header associated with this you can use. I don't have the sdk handy to check. Makoto's suggestion would be ok too I think.
Assignee: nobody → m_kato
Attachment #8641826 - Attachment is obsolete: true
Attachment #8645533 - Flags: review?(jmathies)
Attachment #8645533 - Flags: review?(jmathies) → review+
https://hg.mozilla.org/mozilla-central/rev/1954d80916b4
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: mozilla42 → mozilla43
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: