Skip to content

Conversation

@jlaanstra
Copy link
Contributor

@jlaanstra jlaanstra commented Jan 30, 2020

A WinMD file produced by a static library gets merged into the WinMD of the Dll project consuming the library. Because they often share a root namespace, the files might have the same name and they can overwrite each other in the output folder.

The way this was fixed is to simply remove the static lib from the list of project references. However this causes issues for the case where a CX dll project references a C++/WinRT static library as it doesn't see the reference. A better fix is to mark the reference as private so it won't be copied to the output directory of the Dll project.

TODO:

  • Verify razzle.
  • Verify Visual Studio.

Fixes #504

@jlaanstra
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@jlaanstra
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@jlaanstra
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@jlaanstra jlaanstra merged commit fcdbc24 into master Jan 30, 2020
@jlaanstra jlaanstra deleted the user/jlaans/504 branch January 30, 2020 15:13
Copy link
Member

@ChrisGuzak ChrisGuzak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for taking on this work

and then remove them. -->
<Target Name="CppWinRTRemoveStaticLibraries"
DependsOnTargets="GetCppWinRTProjectWinMDReferences"
<!-- Static library reference WinMDs are merged into the project WinMD that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

referenced

references it and might have the same name because they often share namespace.
Therefore they shouldn't be copied to the output folder
because they might override files in the output folder with the
same name, causing missing types. -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider "missing types when linking"

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

Successfully merging this pull request may close these issues.

A CX runtime component can't reference types from a C++/WinRT static library.

4 participants