Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build MixedRemoteViewCompositor, VS2017, sdk 10.0.16299 #297

Open
stjohn909 opened this issue Aug 1, 2018 · 5 comments
Open

Can't build MixedRemoteViewCompositor, VS2017, sdk 10.0.16299 #297

stjohn909 opened this issue Aug 1, 2018 · 5 comments

Comments

@stjohn909
Copy link

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.

@546296169
Copy link

I also encountered this problem:(

@benzben
Copy link

benzben commented Nov 8, 2018

Have the very same problem here

@Prin-E
Copy link

Prin-E commented Jan 3, 2019

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

@danilogr
Copy link
Contributor

danilogr commented Jun 20, 2019

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 (Can't build MixedRemoteViewCompositor, VS2017, sdk 10.0.16299 #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
Copy link
Contributor

danilogr commented Jun 21, 2019

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants