Skip to content

Installing latest Keyvault-Keys library through vcpkg results in linker errors to credential classes #2741

@kyle-patterson

Description

@kyle-patterson

Describe the bug
When installing keyvault-keys 4.0.0 through vcpkg, the linker will not find ClientSecretCredential or ManagedIdentityCredential.

Exception or Stack Trace
Exception when building:

unresolved external symbol "const Azure::Identity::ClientSecretCredential::`vftable'" (??_7ClientSecretCredential@Identity@Azure@@6b@) referenced in function "public: __cdecl Azure::Identity::ClientSecretCredential::ClientSecretCredential(class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<char,struct std::char_traits,class std::allocator >,struct Azure::Core::Credentials::TokenCredentialOptions const &)" (??0ClientSecretCredential@Identity@Azure@@qeaa@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@00AEBUTokenCredentialOptions@Credentials@Core@2@@z)

Error LNK2019 unresolved external symbol "public: __cdecl Azure::Identity::ManagedIdentityCredential::ManagedIdentityCredential(class std::basic_string<char,struct std::char_traits,class std::allocator > const &,struct Azure::Core::Credentials::TokenCredentialOptions const &)" (??0ManagedIdentityCredential@Identity@Azure@@qeaa@AEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@AEBUTokenCredentialOptions@Credentials@Core@2@@z) referenced in function "void __cdecl std::_Construct_in_place<class Azure::Identity::ManagedIdentityCredential,char * &>(class Azure::Identity::ManagedIdentityCredential &,char * &)" (??$_Construct_in_place@VManagedIdentityCredential@Identity@Azure@@AEAPEAD@std@@YAXAEAVManagedIdentityCredential@Identity@Azure@@AEAPEAD@Z)

To Reproduce

  1. install package: vcpkg install azure-security-keyvault-keys-cpp (any triplet)
  2. In cmakelists:
add find_package(azure-security-keyvault-keys-cpp CONFIG REQUIRED)
target_link_libraries(main PRIVATE Azure::azure-security-keyvault-keys)
  1. Generate cache and build

Setup (please complete the following information):

  • OS: Windows 10, 64-bit
  • IDE : Visual Studio 2019
  • Version of the Library used: keys 4.0.0, identity 1.1.0, core 1.2.0

Additional context
Building from latest main resolves the issue, it seems to only be when installing through vcpkg. Additionally, explicitly linking to azure-identity (ie, target_link_libraries(main PRIVATE Azure::azure-identity)) will resolve ManagedIdentityCredential, but not ClientSecretCredential.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Metadata

Metadata

Assignees

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions