I am trying to create a Windows-based VC++ DLL (in VS 2015) that statically links to the Casablanca CPPREST SDK. That is, I would like a single DLL output which contains the CPP REST library along with my code.
I have referred to this thread, however it seems rather dated (and has broken links):
https://katyscode.wordpress.com/2014/04/01/how-to-statically-link-the-c-rest-sdk-casablanca/
I have tried to download the Casablanca repo from GitHub and compile the "cpprestsdk140.static" project which produces a lib file. The problem is I get a number of unresolved externals when linking it with my project.
Numerous people have commented on the unresolved link errors in the above-mentioned URL. There are also numerous threads on Github with people saying they cannot link simple projects with the static library.
Does anyone have a clear set of steps that can help resolve this?
OK, I pooled together a number of suggestions from the various threads and have the following set of steps in order to successfully link to the CPP REST static library:
Now, in your own project:
I hope this helps someone (I'm sure it will)!