-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
v141 static 3p library using CRT DLL #1745
Comments
I want to run vcpkg install again, but only after I figure out to make sure it correctly sets vc141. Can someone please tell me how to: a) control the tool chain to be 141 |
In the triplets folder, I created: x64-windows-static-md.cmake set(VCPKG_TARGET_ARCHITECTURE x64) In a VS2017 Cmd Prompt: vcpkg install cpprestsdk:x64-windows-static-md In the folder: vcpkg\installed\x64-windows-static-md\debug\lib Files: As you can see, they are neither 141, nor are they md. |
To restore #pragma linking, bugs must be fixed in vcpkg to create the properly named lib files. Tried changing this to 141: However, this resulted in: Vcpkg version: 0.0.84-unknownhash Someone please fix this ASAP. |
Your triplet is correct and works fine, I just tried it myself. |
Yes, my triplet is fine, but vcpkg software has a bug. It mislabels the resulting lib files. What would be the point of Boost having a naming scheme if vcpkg is going to ignore it? Either vcpkg has a bug or they are being deliberately deceptive about it. |
There's a longer discussion in #1338 (comment), however the crux of the issue is that all of the features provided by Boost's library name are already present in Vcpkg's buildsystem integration (including autolinking, in MSBuild). We've tried pretty much every alternative (including not renaming!) however we've found that renaming them in this way minimizes the total amount of pain. Could you provide a full set of repro steps that uses one of the Vcpkg integration mechanisms? |
I originally tried the integrate command, but it was a disaster. It fails the software prime directive that everything should be maintainable, and therefore discover-able. Since my triplet specifies v141 and linking with CRT as DLL, the resulting lib files should be named appropriately. |
@VikingExplorer I maintain a fork of vcpkg exactly for this reason. I haven't completely understand the reasoning of vcpkg team for the Boost case since after removing the renaming steps everything always works as expected. We have added triplets for dynamic CRT linking and creation of static libraries instead of dlls. |
Since this seems to be still marked as "needs repro" (even though provided), I'll try to restate the problem more clearly: x86-windows-static-md.cmake Triplet: (v141 is the default) x64-windows-static-md.cmake Triplet: Steps to reproduce:
Result: boost_system-vc140-mt-gd-1_66.lib Building my project, I get: Linking to lib file: boost_system-vc141-mt-gd-1_66.lib Error: not found.My work around is to modify autolink.hpp: #define BOOST_LIB_PREFIX "" I have to repeat this modification every time I update boost. It's a pain. Shouldn't have to. |
They have now dropped the version number all together. IMO, it's a design flaw. I now have to modify autolink.hpp with every boost update, since it's not possible to use the normal boost customization's: FROM:
TO:
|
The biggest and most important use case for DLLs is for common code that changes rarely and is almost always backwardly compatible. In short, that's absolutely the windows API. That's why the CRT DLL should always be linked. I don't think it makes any sense to increase the size of one's own binaries by statically linking CRT.
However, it's quite a different story for our own modules/libraries and third party libraries we may use. To make these into DLLs implies that multiple EXEs will take advantage of shared DLLs to save RAM while being used by the customer.
A) customer using multiple EXEs from the same vendor is an edge case.
B) RAM is so plentiful, it's hardly worth the effort to use a DLL
C) DLLs introduces a significant deployment nightmare, otherwise known as DLL Hell.
D) using static libs excludes all unused/dead code from binaries, where DLLs include it all.
Given these two points, I naturally assumed that static 3p libraries linking to CRT DLL would be the default.
So, I'm surprised that the two triplets provided are:
DLL - CRT.DLL
Static - CRT-static
Neither of which seem particularly useful. Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: