Linker Issues when using the cpp REST SDK as static library

Oct 5, 2015 at 1:48 PM
Based on the other threads, created a static library of the cpp REST SDK project.
But when tried using this library in another project, getting many linker errors.

Any help on this would be helpful.
Coordinator
Oct 6, 2015 at 4:52 AM
hey maddiaks

Could you provide more details about the errors you are hitting?
For instance,
  • the platform
  • VS version if on windows
  • how are you creating the static library
  • what are you trying to achieve, sample repro code
  • what are the exact error messages
Thanks
Kavya
Oct 6, 2015 at 6:56 AM
Hi Kavya,

For instance,
the platform ==> Windows 2008 R2
VS version if on windows ==> Visual Studio 2013
how are you creating the static library ==> I followed this link (https://katyscode.wordpress.com/2014/04/01/how-to-statically-link-the-c-rest-sdk-casablanca/) to build the static library. This is bit old article.
what are you trying to achieve, sample repro code ==> Making REST calls. 
what are the exact error messages
Error Message(s):
1>cpprest120.lib(web_utilities.obj) : error LNK2001: unresolved external symbol CryptProtectMemory
1>cpprest120.lib(web_utilities.obj) : error LNK2001: unresolved external symbol CryptUnprotectMemory
1>cpprest120.lib(oauth1.obj) : error LNK2001: unresolved external symbol BCryptOpenAlgorithmProvider
1>cpprest120.lib(oauth1.obj) : error LNK2001: unresolved external symbol BCryptGetProperty
1>cpprest120.lib(oauth1.obj) : error LNK2001: unresolved external symbol BCryptCreateHash
1>cpprest120.lib(oauth1.obj) : error LNK2001: unresolved external symbol BCryptHashData
1>cpprest120.lib(oauth1.obj) : error LNK2001: unresolved external symbol BCryptFinishHash
1>cpprest120.lib(oauth1.obj) : error LNK2001: unresolved external symbol BCryptDestroyHash
1>cpprest120.lib(oauth1.obj) : error LNK2001: unresolved external symbol BCryptCloseAlgorithmProvider
Oct 6, 2015 at 10:54 AM
Hi Kavya,

Able to resolve these linker issues by including the below libraries:
Crypt32.lib
Bcrypt.lib

But I am seeing a strange issue. The first REST call is taking around 15 seconds while it is not the case with subsequent REST calls.

Is it a know behavior?

Thanks,