Qpid lesson 2 configuring Boost dependent Library Environment variables
Scene
Qpid depends on the Boost library. In general, when you use CMake to generate a VS solution, you need to specify the boost header file and the library file directory, otherwise the following compilation error occurs:
Could not find the following Boost libraries: boost_sysytem, boost_thread
Solution one:
Create a new one in the environment variable: named BOOST_ROOT with a value of E:\ work2\ boost_1_58_0
Solution 2:
Create a new one in the environment variable: named BOOST_INCLUDEDIR with a value of E:\ work2\ boost_1_58_0
Create a new one in the environment variable: named BOOST_LIBRARYDIR with a value of E:\ work2\ boost_1_58_0\ stage\ lib
Restart the system for the environment variables to take effect
Matters needing attention
1) CMake can only search dynamic libraries compiled by Boost, but static libraries cannot be searched.
2) directly from the official compiled package, and in the compiled package, the name of the library file directory is lib64-msvc-12.0, which needs to be modified to lib or stage/lib
How do FindBoost.cmake files search for Boost lib files?
The following is the script code to search for Boost lib, of course, if you do not modify the library file directory, you can add the following
${Boost_INCLUDE_DIR} / lib64-msvc-12.0
List (APPEND _ boost_LIBRARY_SEARCH_DIRS_$ {c})
${Boost_INCLUDE_DIR} / lib
${Boost_INCLUDE_DIR} /.. / lib
${Boost_INCLUDE_DIR} / stage/lib
)
3) download Boost source code compiled dynamic library
B2.exe-build-type=complete-build-dir=build_tmp toolset=msvc-14.0 address-model=32 stage
Description: stage instructions copy the compiled library files to the stage directory, save the files of the generation process in the build_tmp directory, and toolset specifies to use the VS2015 compiler