Statically linking Casablanca/CPPREST SDK

前端 未结 3 950
谎友^
谎友^ 2021-01-12 13:22

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 th

3条回答
  •  心在旅途
    2021-01-12 14:02

    One more addition to the Simple Guy's answer: If you use http_listener class in your project it is likely you will need Httpapi.lib to fix linker errors.

    And also I want to propose an easier way to compile a static cpprestdk library. I've successfully used it to build my project in VS2017.

    1. install vcpkg from https://github.com/Microsoft/vcpkg
    2. Compile cpprestsdk using following commands:

      Step 1. vcpkg install cpprestsdk:x86-windows-static

      Step 2. vcpkg install cpprestsdk:x64-windows-static

    3. Follow the second part of Simple Guy's answer starting from your project settings. Additionally, use my advice from above and BobC to fix linker errors.

    Enjoy!

提交回复
热议问题