Have a small C++ app to test some Azure Blob Storage features with in Visual Studio 2019. Have followed the instructions here to install azure-storage-cpp sdk using vcpkg but when I try to run the app I get the following linker error:
AzureConsoleApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) private: void __cdecl azure::storage::cloud_storage_account::initialize_default_endpoints(bool)" (__imp_?initialize_default_endpoints@cloud_storage_account@storage@azure@@AEAAX_N@Z) referenced in function "public: __cdecl azure::storage::cloud_storage_account::cloud_storage_account(class azure::storage::storage_credentials const &,bool)" (??0cloud_storage_account@storage@azure@@QEAA@AEBVstorage_credentials@12@_N@Z)
vcpkg reports the following as installed:
azure-storage-cpp:x64-windows-static 7.0.0
Microsoft Azure Storage Client SDK for C++ A cli...
I need to use the static release of azure-storage-cpp for the app hence the x64-windows-static.
From reading the vcpkg docs it's an install and forget type of tool with the tool itself stating:
All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available.
What have I missed?
Need to define #define _NO_WASTORAGE_API before including azure storage sdk headers and manually include all the necessary azure storage SDK reference libraries (xmllite.lib, bcrypt.lib, rpcrt4.lib, Crypt32.lib, Winhttp.lib) in the linker input.
Found my answer here.