MixedRealityCompanionKit icon indicating copy to clipboard operation
MixedRealityCompanionKit copied to clipboard

Can't build MixedRemoteViewCompositor, VS2017, sdk 10.0.16299

Open stjohn909 opened this issue 6 years ago • 5 comments

Compiler errors in both Win32 and WSA builds when target platform changed to sdk 10.0.16299.0:

1>f:\git\github\mixedrealitycompanionkit\mixedremoteviewcompositor\source\shared\pch.h(78): error C2374: 'MFSampleExtension_PinholeCameraIntrinsics': redefinition; multiple initialization 1>c:\program files (x86)\windows kits\10\include\10.0.16299.0\um\mfapi.h(3382): note: see declaration of 'MFSampleExtension_PinholeCameraIntrinsics' 1>f:\git\github\mixedrealitycompanionkit\mixedremoteviewcompositor\source\wsa\mixedremoteviewcompositor.h(1064): error C2059: syntax error: '}' 1>f:\git\github\mixedrealitycompanionkit\mixedremoteviewcompositor\source\wsa\mixedremoteviewcompositor.h(1064): error C2143: syntax error: missing ';' before '}' 1>f:\git\github\mixedrealitycompanionkit\mixedremoteviewcompositor\source\wsa\mixedremoteviewcompositor.h(1071): error C2143: syntax error: missing ';' before '{' 1>f:\git\github\mixedrealitycompanionkit\mixedremoteviewcompositor\source\wsa\mixedremoteviewcompositor.h(1071): error C2447: '{': missing function header (old-style formal list?) 1>f:\git\github\mixedrealitycompanionkit\mixedremoteviewcompositor\source\shared\pch.cpp(5): fatal error C1004: unexpected end-of-file found 1>Done building project "WSA.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I don't know where to start looking for the problem. Somehow I got this working yesterday, but I have no idea what I did. Thanks.

stjohn909 avatar Aug 01 '18 01:08 stjohn909

I also encountered this problem:(

546296169 avatar Aug 15 '18 08:08 546296169

Have the very same problem here

benzben avatar Nov 08 '18 10:11 benzben

I installed VS2015, Windows SDK 10586, 10240 and solved the problem. :-/

Prin-E avatar Jan 03 '19 02:01 Prin-E

Hello, I am having the same problem. It seems to be related to changing versions of the MIDLRT Compiler (it goes from 8.01.0622 to 10.00.0206) and the source code in MixedRemoteViewCompositor.idl.

Let me elaborate: I am upgrading MixedRemoteViewCompositor to 10.0.18362.0 and v142. While moving to v142 wasn't a problem, I ran into the following two problems when upgrading to a newer Windows SDK version:

  • 10.0.14393.0 introduces MFPinholeCameraIntrinsics, so I had to make sure MixedRemoteViewCompositor uses ABI::MixedRemoteViewCompositor::MFPinholeCameraIntrinsics instead of the ambiguous MFPinholeCameraIntrinsics.
  • 10.0.15063.0 works without further changes after the above change
  • 10.0.16299.0 fails with the problem listed on this issue (#297)

My current hunch to fix this is to remove / change some of the cpp_quote commands in MixedRemoteViewCompositor.idl. For instance, this looks rather sketchy to me:

 // Additional imports to ensure that all required headers are included
cpp_quote("#if defined(__cplusplus)")
cpp_quote("}")
cpp_quote("#endif // defined(__cplusplus)")

Whoever wrote this really knew what they were doing but did not document the reasons for what they did. I tried looking into the generated files MixedRemoteViewCompositor.h but they differ a lot across versions (MIDLRT Compiler Engine Version 10.00.0206 generates 9724 lines and MIDL compiler version 8.01.0622 generates 10264 lines).

EDIT: I made the changes above and liked in this issue. It runs on 10.0.17134+. So, if you need to use MRVC take a look at the changes linked below.

Thanks,

danilogr avatar Jun 20 '19 16:06 danilogr

Honestly, at this point it is worth looking at this instead of upgrading the MixedRemoteViewCompositor: https://github.com/microsoft/MixedRealityCompanionKit/tree/master/RealtimeStreaming. It is written using C++/WinRT instead of the deprecated C++/WRL. Also, it runs on Windows 10 1809 (SDK 10.0.17763).

danilogr avatar Jun 21 '19 22:06 danilogr