VS 11 Beta does not build static library with WinRT calls in source code (compiled with /Zw) - by OmniGSoft

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 728165 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 3/2/2012 11:30:54 AM
Access Restriction Public
Moderator Decision Sent to Engineering Team for consideration

Description

Hi VS 11 Team:
I have to open a new thread to report the following issue, which has been reported earlier in a thread (http://connect.microsoft.com/VisualStudio/feedback/details/722313/vs11-build-with-8175-will-not-allow-the-creation-of-c-static-lib-that-calls-winrt-apis) but that thread has been already closed.

It looks like the bug is still in the VS 11 Beta. 
When we build a static library with WinRT calls in the source code, the compiler still gives error message "error LNK1326: archiving OBJ compiled with /ZW into static lib is not supported".

Is there a work around for this?
OmniGSoft
Sign in to post a comment.
Posted by thefans on 3/7/2012 at 11:27 AM
Thanks, YongKang. Putting /force:allowzwobj to Librarian part of Command Line works perfectly. However, only adding that to a newly created Metro style static library isn't enough.

First of all, in Configuration Properties -> General, "Metro Style App Support" still can't be turned on, but the C/C++ -> General one can. However, even with that, Debug part of Code Generation -> Enable Minimal Rebuild still needs to be turned off manually. Lastly, these lines need to be added to C/C++'s Command Line part:

/FU Platform.winmd /FU Windows.winmd /AI "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcpackages" /AI "$(WindowsSDK_MetadataPath)"

I hope these manual changes won't be necessary in the next release.
Posted by Microsoft on 3/7/2012 at 10:47 AM
We have fixed this issue and the fix will be included in the major release of VS 11. With VS 11 Beta, the workaround is to add /force:allowzwobj onto the command line.

Thanks again for your feedback.

YongKang Zhu
--
VC++ CodeGen and Tools
Posted by MS-Moderator07 [Feedback Moderator] on 3/4/2012 at 7:09 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 3/4/2012 at 5:25 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)