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

[poco] MTd link failure #38462

Open
az-faro opened this issue Apr 29, 2024 · 0 comments
Open

[poco] MTd link failure #38462

az-faro opened this issue Apr 29, 2024 · 0 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@az-faro
Copy link

az-faro commented Apr 29, 2024

Describe the bug
I use the poco library via vcpkg. The application uses /MTd runtime library, but vcpkg is set to not use static libraries. Poco builds correctly, but in the linking stage I get LINK : fatal error LNK1104: cannot open file 'PocoFoundationmtd.lib'.

Environment

  • OS: Windows 10
  • Compiler: Microsoft Visual C++ 2019, version 16.11.15

To Reproduce
Steps to reproduce the behavior:

  1. Add {"name":"poco", "platform": "x64|windows"} to vcpkg.json.
  2. Create Visual Studio C++ project with vcpkg activated that uses some Poco functionality (for example #include "Poco/URI.h").
  3. The vcpkg config in the project is the default apart from Use Vcpkg Manifest that is set to Yes. Particularly Use Static Libraries is set to No, but this should be the default.
  4. Build project in debug config with Runtime Library set to Multi-threaded Debug (/MTd)

Expected behavior
I would expect the project to link correctly and give me access to Poco functionality.

Failure logs

1>------ Build started: Project: PocoTest, Configuration: Debug x64 ------
1>LINK : fatal error LNK1104: cannot open file 'PocoFoundationmtd.lib'
1>Done building project "PocoTest.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Additional context

  • I could get the linking to work correctly by adding $(VcpkgManifestRoot)\vcpkg_installed\x64-windows-static\x64-windows-static\debug\lib to the Linker -> General -> Additoinal LIbrary Directories setting, but this shouldn't be needed. And I'm not even sure this is the correct linking.
  • The PocoFoundatinmtd.lib is correctly built, it's just the linking that is incorrect. However I suspect the linking path is probably correct and the error is trying to link to the mtd variant of the library when it should be just the d variant.
  • Note that this particular configuration of /MTd + vcpkg as dll links just fine with other libraries such as nlohmann-json and miniz.
@FrankXie05 FrankXie05 added the category:port-bug The issue is with a library, which is something the port should already support label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

No branches or pull requests

2 participants