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

[msmpi] Fix /MD for static libs. #6945

Merged
merged 2 commits into from
Jun 19, 2019

Conversation

NancyLi1013
Copy link
Contributor

When building static library with dynamic CRT, it failed with:

Expected Release,Dynamic crt linkage, but the following libs had invalid crt linkage:

    F:/vcpkgissue/vcpkg/packages/msmpi_x64-windows/lib/msmpifec.lib: Release,Static
    F:/vcpkgissue/vcpkg/packages/msmpi_x64-windows/lib/msmpifmc.lib: Release,Static

To inspect the lib files, use:
    dumpbin.exe /directives mylibfile.lib

So I added set(VCPKG_CRT_LINKAGE static) to fix it.
Related issue #2059.

@NancyLi1013 NancyLi1013 added the info:internal This PR or Issue was filed by the vcpkg team. label Jun 18, 2019
@NancyLi1013 NancyLi1013 marked this pull request as ready for review June 18, 2019 10:01
@ras0219-msft
Copy link
Contributor

This is (unfortunately) not a bug.

CRT linkage MUST be the same between the consumer and the library (except very, very special libraries).

In this case, the consumer's code will be using the dynamic CRT. Therefore, we must also ensure that any libraries we install are also using the dynamic CRT.

Looking at what we have available, I've changed the install process to not install those particular libraries when building against the static crt. I think this should fix the user's issue.

@ras0219-msft ras0219-msft merged commit d3498a8 into microsoft:master Jun 19, 2019
@NancyLi1013
Copy link
Contributor Author

@ras0219-msft, thanks a lot for your clear description and your efforts for this PR. I have gotten it. I'll pay more attention to these types of issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants