I was successful with static linking when used the following steps:
C++REST For Release .lib:
User Code:
The User Code must include also the Boost and SSL libraries.
Configuration Properties -> VC++Directories -> Library Directories :
C:\ ... \OpenSSL\lib\VC\static
C:\ ... \Boost\boost_1_57_0\stage\lib
C:\ ... \CppREST\lib\Release (<-- Copied the "cpprest120_2_4_Release_Win32.lib" here.)
The User Code must include the include directory:
Configuration Properties -> VC++Directories -> Include Directories :
C:\ ... \CppREST\include (<-- Copied the cpprest and pplx folders here whit *.h.)
add in:
Configuration Properties ->C/C+=-> Preprocessor -> Processor Definitions :
_NO_ASYNCRTIMP
_NO_PPLXIMP
add in:
Configuration Properties ->Linker ->
libeay32MT.lib
ssleay32MT.lib
crypt32.lib
It would be more logical (for me) if library A uses lib1.lib and lib2.lib to make libA.lib, and if somebody uses libA.lib it should not need to include in the project the lib1.lib and lib2.lib .?
C++REST For Release .lib:
- Configuration Properties -> General -> Target Extension : .lib (from .dll)
- Configuration Properties -> Configuration Type : Ststic library (.lib)
- Configuration Properties -> C/C+=-> Optimization-> Whole Program Optimization : No
- Configuration Properties -> C/C+=-> Preprocessor -> Processor Definitions : _NO_ASYNCRTIMP (added)
-
Configuration Properties -> C/C+=-> Code Generation -> Runtime Library: Multi-threaded (/MT)
User Code:
The User Code must include also the Boost and SSL libraries.
Configuration Properties -> VC++Directories -> Library Directories :
C:\ ... \OpenSSL\lib\VC\static
C:\ ... \Boost\boost_1_57_0\stage\lib
C:\ ... \CppREST\lib\Release (<-- Copied the "cpprest120_2_4_Release_Win32.lib" here.)
The User Code must include the include directory:
Configuration Properties -> VC++Directories -> Include Directories :
C:\ ... \CppREST\include (<-- Copied the cpprest and pplx folders here whit *.h.)
add in:
Configuration Properties ->C/C+=-> Preprocessor -> Processor Definitions :
_NO_ASYNCRTIMP
_NO_PPLXIMP
add in:
Configuration Properties ->Linker ->
libeay32MT.lib
ssleay32MT.lib
crypt32.lib
bcrypt.lib
I do not understand why the "cpprest120_2_4_Release_Win32.lib" not contain all the required functions from it's libraries like the used SSL and Boost components?It would be more logical (for me) if library A uses lib1.lib and lib2.lib to make libA.lib, and if somebody uses libA.lib it should not need to include in the project the lib1.lib and lib2.lib .?