[MONGOCRYPT-210] Unable to statically link to `mongocrypt-static.lib` on windows Created: 18/Nov/19  Updated: 28/Oct/23  Resolved: 02/Dec/19

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0

Type: Bug Priority: Major - P3
Reporter: Matt Broadstone Assignee: Matt Broadstone
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The way that libmongocrypt is currently linking to kms_message is broken such that no outside library can statically link to the library because a number of symbols are not found. The issue only seems to present itself on windows, and there is a TODO in the CMakeLists.txt acknowledging the issue and hacking around it by using object files only available in the CMake build for libmongocrypt itself.



 Comments   
Comment by Githook User [ 19/Nov/19 ]

Author:

{'name': 'Matt Broadstone', 'username': 'mbroadst', 'email': 'mbroadst@mongodb.com'}

Message: MONGOCRYPT-210 fix static builds on windows

Since kms_message is built as a static library, it needs to be
included on the link line for all statically compiled targets that
need to include it. Additionally, `KMS_MSG_STATIC` needed to be
defined during `mongocrypt_static` compilation in order to avoid
prefixing symbols which assumed a dynamic build.
Branch: master
https://github.com/mongodb/libmongocrypt/commit/cb60ba17a7b996f999ddb26316e1bf571757e66f

Comment by Matt Broadstone [ 18/Nov/19 ]

https://github.com/mongodb/libmongocrypt/pull/77

Generated at Thu Feb 08 09:08:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.