Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmake v3.15.3 cannot find boost v1.71.0

Tags:

boost

cmake

I am trying to build from source the following software in Windows 10: https://github.com/FreeOpcUa/freeopcua. I have also installed the latest version of the boost libraries (boost_1_71_0) but when I try to use CMake for compiling the source code, CMake cannot find the location of boost.

Environment: Windows 10
CMake version: 3.15.3
boost version: 1.71.0

  1. I have downloaded the latest version of boost from this link: https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.zip
  2. I have extracted the content.
  3. Inside the extracted folder I have executed: .\bootstrap.bat
  4. After bootstrap has finished I have executed: .\b2
  5. After b2 finished, I changed to the extracted directory for FreeOpcUa and created a build directory: mkdir build
  6. I changed to the new directory: cd ./build
  7. I tried to compile the source with: cmake .. -DBOOST_ROOT="C:\Program Files\boost\boost_1_71_0"

CMake prompts the following:

cmake .. -DBOOST_ROOT="C:\Program Files\boost\boost_1_71_0"  
-- Building for: Visual Studio 14 2015  
-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.18362.  
-- The C compiler identification is MSVC 19.0.24215.1  
-- The CXX compiler identification is MSVC 19.0.24215.1  
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe  
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works  
-- Detecting C compiler ABI info  
-- Detecting C compiler ABI info - done  
-- Detecting C compile features  
-- Detecting C compile features - done  
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe  
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works  
-- Detecting CXX compiler ABI info  
-- Detecting CXX compiler ABI info - done  
-- Detecting CXX compile features  
-- Detecting CXX compile features - done  
-- Looking for pthread.h  
-- Looking for pthread.h - not found  
-- Found Threads: TRUE  
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):  
  Could NOT find Boost (missing: system program_options filesystem thread)  
  (found version "1.71.0")  
Call Stack (most recent call first):  
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)  
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2161 (find_package_handle_standard_args)  
  CMakeLists.txt:108 (find_package)  


-- Configuring incomplete, errors occurred!  
See also "C:/Users/Dunkes/Desktop/C++_SDKs/FreeOpcUa/freeopcua-master/build/CMakeFiles/CMakeOutput.log".  
See also "C:/Users/Dunkes/Desktop/C++_SDKs/FreeOpcUa/freeopcua-master/build/CMakeFiles/CMakeError.log".  

As user @Tsyvarev has suggested, if I run CMake with the -DBoost_DEBUG=ON option I get the following:

-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.18362.
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1446 ] _boost_TEST_VERSIONS = "1.71.0;1.71;1.70.0;1.70;1.69.0;1.69;1.68.0;1.68;1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65;1.64.0;1.64;1.63.0;1.63;1.62.0;1.62;1.61.0;1.61;1.60.0;1.60;1.59.0;1.59;1.58.0;1.58;1.57.0;1.57;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1447 ] Boost_USE_MULTITHREADED = "TRUE"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1448 ] Boost_USE_STATIC_LIBS = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1449 ] Boost_USE_STATIC_RUNTIME = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1450 ] Boost_ADDITIONAL_VERSIONS = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1451 ] Boost_NO_SYSTEM_PATHS = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1520 ] BOOST_ROOT = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1521 ] ENV{BOOST_ROOT} = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1522 ] BOOST_INCLUDEDIR = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1523 ] ENV{BOOST_INCLUDEDIR} = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1524 ] BOOST_LIBRARYDIR = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1525 ] ENV{BOOST_LIBRARYDIR} = <unset>
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1597 ] _boost_INCLUDE_SEARCH_DIRS = "PATHS;C:/local/boost_1_71_0;PATHS;C:/local/boost_1_71;PATHS;C:/local/boost_1_70_0;PATHS;C:/local/boost_1_70;PATHS;C:/local/boost_1_69_0;PATHS;C:/local/boost_1_69;PATHS;C:/local/boost_1_68_0;PATHS;C:/local/boost_1_68;PATHS;C:/local/boost_1_67_0;PATHS;C:/local/boost_1_67;PATHS;C:/local/boost_1_66_0;PATHS;C:/local/boost_1_66;PATHS;C:/local/boost_1_65_1;PATHS;C:/local/boost_1_65_0;PATHS;C:/local/boost_1_65;PATHS;C:/local/boost_1_64_0;PATHS;C:/local/boost_1_64;PATHS;C:/local/boost_1_63_0;PATHS;C:/local/boost_1_63;PATHS;C:/local/boost_1_62_0;PATHS;C:/local/boost_1_62;PATHS;C:/local/boost_1_61_0;PATHS;C:/local/boost_1_61;PATHS;C:/local/boost_1_60_0;PATHS;C:/local/boost_1_60;PATHS;C:/local/boost_1_59_0;PATHS;C:/local/boost_1_59;PATHS;C:/local/boost_1_58_0;PATHS;C:/local/boost_1_58;PATHS;C:/local/boost_1_57_0;PATHS;C:/local/boost_1_57;PATHS;C:/local/boost_1_56_0;PATHS;C:/local/boost_1_56;PATHS;C:/local/boost_1_55_0;PATHS;C:/local/boost_1_55;PATHS;C:/local/boost_1_54_0;PATHS;C:/local/boost_1_54;PATHS;C:/local/boost_1_53_0;PATHS;C:/local/boost_1_53;PATHS;C:/local/boost_1_52_0;PATHS;C:/local/boost_1_52;PATHS;C:/local/boost_1_51_0;PATHS;C:/local/boost_1_51;PATHS;C:/local/boost_1_50_0;PATHS;C:/local/boost_1_50;PATHS;C:/local/boost_1_49_0;PATHS;C:/local/boost_1_49;PATHS;C:/local/boost_1_48_0;PATHS;C:/local/boost_1_48;PATHS;C:/local/boost_1_47_0;PATHS;C:/local/boost_1_47;PATHS;C:/local/boost_1_46_1;PATHS;C:/local/boost_1_46_0;PATHS;C:/local/boost_1_46;PATHS;C:/local/boost_1_45_0;PATHS;C:/local/boost_1_45;PATHS;C:/local/boost_1_44_0;PATHS;C:/local/boost_1_44;PATHS;C:/local/boost_1_43_0;PATHS;C:/local/boost_1_43;PATHS;C:/local/boost_1_42_0;PATHS;C:/local/boost_1_42;PATHS;C:/local/boost_1_41_0;PATHS;C:/local/boost_1_41;PATHS;C:/local/boost_1_40_0;PATHS;C:/local/boost_1_40;PATHS;C:/local/boost_1_39_0;PATHS;C:/local/boost_1_39;PATHS;C:/local/boost_1_38_0;PATHS;C:/local/boost_1_38;PATHS;C:/local/boost_1_37_0;PATHS;C:/local/boost_1_37;PATHS;C:/local/boost_1_36_1;PATHS;C:/local/boost_1_36_0;PATHS;C:/local/boost_1_36;PATHS;C:/local/boost_1_35_1;PATHS;C:/local/boost_1_35_0;PATHS;C:/local/boost_1_35;PATHS;C:/local/boost_1_34_1;PATHS;C:/local/boost_1_34_0;PATHS;C:/local/boost_1_34;PATHS;C:/local/boost_1_33_1;PATHS;C:/local/boost_1_33_0;PATHS;C:/local/boost_1_33;PATHS;C:/boost/include;C:/boost;/sw/local/include"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1598 ] _boost_PATH_SUFFIXES = "boost-1_71_0;boost_1_71_0;boost/boost-1_71_0;boost/boost_1_71_0;boost-1_71;boost_1_71;boost/boost-1_71;boost/boost_1_71;boost-1_70_0;boost_1_70_0;boost/boost-1_70_0;boost/boost_1_70_0;boost-1_70;boost_1_70;boost/boost-1_70;boost/boost_1_70;boost-1_69_0;boost_1_69_0;boost/boost-1_69_0;boost/boost_1_69_0;boost-1_69;boost_1_69;boost/boost-1_69;boost/boost_1_69;boost-1_68_0;boost_1_68_0;boost/boost-1_68_0;boost/boost_1_68_0;boost-1_68;boost_1_68;boost/boost-1_68;boost/boost_1_68;boost-1_67_0;boost_1_67_0;boost/boost-1_67_0;boost/boost_1_67_0;boost-1_67;boost_1_67;boost/boost-1_67;boost/boost_1_67;boost-1_66_0;boost_1_66_0;boost/boost-1_66_0;boost/boost_1_66_0;boost-1_66;boost_1_66;boost/boost-1_66;boost/boost_1_66;boost-1_65_1;boost_1_65_1;boost/boost-1_65_1;boost/boost_1_65_1;boost-1_65_0;boost_1_65_0;boost/boost-1_65_0;boost/boost_1_65_0;boost-1_65;boost_1_65;boost/boost-1_65;boost/boost_1_65;boost-1_64_0;boost_1_64_0;boost/boost-1_64_0;boost/boost_1_64_0;boost-1_64;boost_1_64;boost/boost-1_64;boost/boost_1_64;boost-1_63_0;boost_1_63_0;boost/boost-1_63_0;boost/boost_1_63_0;boost-1_63;boost_1_63;boost/boost-1_63;boost/boost_1_63;boost-1_62_0;boost_1_62_0;boost/boost-1_62_0;boost/boost_1_62_0;boost-1_62;boost_1_62;boost/boost-1_62;boost/boost_1_62;boost-1_61_0;boost_1_61_0;boost/boost-1_61_0;boost/boost_1_61_0;boost-1_61;boost_1_61;boost/boost-1_61;boost/boost_1_61;boost-1_60_0;boost_1_60_0;boost/boost-1_60_0;boost/boost_1_60_0;boost-1_60;boost_1_60;boost/boost-1_60;boost/boost_1_60;boost-1_59_0;boost_1_59_0;boost/boost-1_59_0;boost/boost_1_59_0;boost-1_59;boost_1_59;boost/boost-1_59;boost/boost_1_59;boost-1_58_0;boost_1_58_0;boost/boost-1_58_0;boost/boost_1_58_0;boost-1_58;boost_1_58;boost/boost-1_58;boost/boost_1_58;boost-1_57_0;boost_1_57_0;boost/boost-1_57_0;boost/boost_1_57_0;boost-1_57;boost_1_57;boost/boost-1_57;boost/boost_1_57;boost-1_56_0;boost_1_56_0;boost/boost-1_56_0;boost/boost_1_56_0;boost-1_56;boost_1_56;boost/boost-1_56;boost/boost_1_56;boost-1_55_0;boost_1_55_0;boost/boost-1_55_0;boost/boost_1_55_0;boost-1_55;boost_1_55;boost/boost-1_55;boost/boost_1_55;boost-1_54_0;boost_1_54_0;boost/boost-1_54_0;boost/boost_1_54_0;boost-1_54;boost_1_54;boost/boost-1_54;boost/boost_1_54;boost-1_53_0;boost_1_53_0;boost/boost-1_53_0;boost/boost_1_53_0;boost-1_53;boost_1_53;boost/boost-1_53;boost/boost_1_53;boost-1_52_0;boost_1_52_0;boost/boost-1_52_0;boost/boost_1_52_0;boost-1_52;boost_1_52;boost/boost-1_52;boost/boost_1_52;boost-1_51_0;boost_1_51_0;boost/boost-1_51_0;boost/boost_1_51_0;boost-1_51;boost_1_51;boost/boost-1_51;boost/boost_1_51;boost-1_50_0;boost_1_50_0;boost/boost-1_50_0;boost/boost_1_50_0;boost-1_50;boost_1_50;boost/boost-1_50;boost/boost_1_50;boost-1_49_0;boost_1_49_0;boost/boost-1_49_0;boost/boost_1_49_0;boost-1_49;boost_1_49;boost/boost-1_49;boost/boost_1_49;boost-1_48_0;boost_1_48_0;boost/boost-1_48_0;boost/boost_1_48_0;boost-1_48;boost_1_48;boost/boost-1_48;boost/boost_1_48;boost-1_47_0;boost_1_47_0;boost/boost-1_47_0;boost/boost_1_47_0;boost-1_47;boost_1_47;boost/boost-1_47;boost/boost_1_47;boost-1_46_1;boost_1_46_1;boost/boost-1_46_1;boost/boost_1_46_1;boost-1_46_0;boost_1_46_0;boost/boost-1_46_0;boost/boost_1_46_0;boost-1_46;boost_1_46;boost/boost-1_46;boost/boost_1_46;boost-1_45_0;boost_1_45_0;boost/boost-1_45_0;boost/boost_1_45_0;boost-1_45;boost_1_45;boost/boost-1_45;boost/boost_1_45;boost-1_44_0;boost_1_44_0;boost/boost-1_44_0;boost/boost_1_44_0;boost-1_44;boost_1_44;boost/boost-1_44;boost/boost_1_44;boost-1_43_0;boost_1_43_0;boost/boost-1_43_0;boost/boost_1_43_0;boost-1_43;boost_1_43;boost/boost-1_43;boost/boost_1_43;boost-1_42_0;boost_1_42_0;boost/boost-1_42_0;boost/boost_1_42_0;boost-1_42;boost_1_42;boost/boost-1_42;boost/boost_1_42;boost-1_41_0;boost_1_41_0;boost/boost-1_41_0;boost/boost_1_41_0;boost-1_41;boost_1_41;boost/boost-1_41;boost/boost_1_41;boost-1_40_0;boost_1_40_0;boost/boost-1_40_0;boost/boost_1_40_0;boost-1_40;boost_1_40;boost/boost-1_40;boost/boost_1_40;boost-1_39_0;boost_1_39_0;boost/boost-1_39_0;boost/boost_1_39_0;boost-1_39;boost_1_39;boost/boost-1_39;boost/boost_1_39;boost-1_38_0;boost_1_38_0;boost/boost-1_38_0;boost/boost_1_38_0;boost-1_38;boost_1_38;boost/boost-1_38;boost/boost_1_38;boost-1_37_0;boost_1_37_0;boost/boost-1_37_0;boost/boost_1_37_0;boost-1_37;boost_1_37;boost/boost-1_37;boost/boost_1_37;boost-1_36_1;boost_1_36_1;boost/boost-1_36_1;boost/boost_1_36_1;boost-1_36_0;boost_1_36_0;boost/boost-1_36_0;boost/boost_1_36_0;boost-1_36;boost_1_36;boost/boost-1_36;boost/boost_1_36;boost-1_35_1;boost_1_35_1;boost/boost-1_35_1;boost/boost_1_35_1;boost-1_35_0;boost_1_35_0;boost/boost-1_35_0;boost/boost_1_35_0;boost-1_35;boost_1_35;boost/boost-1_35;boost/boost_1_35;boost-1_34_1;boost_1_34_1;boost/boost-1_34_1;boost/boost_1_34_1;boost-1_34_0;boost_1_34_0;boost/boost-1_34_0;boost/boost_1_34_0;boost-1_34;boost_1_34;boost/boost-1_34;boost/boost_1_34;boost-1_33_1;boost_1_33_1;boost/boost-1_33_1;boost/boost_1_33_1;boost-1_33_0;boost_1_33_0;boost/boost-1_33_0;boost/boost_1_33_0;boost-1_33;boost_1_33;boost/boost-1_33;boost/boost_1_33"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1613 ] location of version.hpp: C:/Program Files/boost/boost_1_71_0/boost/version.hpp
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1653 ] Boost_VERSION = "107100"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1654 ] Boost_VERSION_STRING = "1.71.0"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1655 ] Boost_VERSION_MACRO = "107100"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1656 ] Boost_VERSION_MAJOR = "1"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1657 ] Boost_VERSION_MINOR = "71"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1658 ] Boost_VERSION_PATCH = "0"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1659 ] Boost_VERSION_COUNT = "3"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1676 ] Boost_LIB_PREFIX = ""
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1677 ] Boost_NAMESPACE = "boost"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:787 ] _boost_COMPILER = "-vc140" (guessed)
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1713 ] _boost_MULTITHREADED = "-mt"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1790 ] _boost_ARCHITECTURE_TAG = "-x32" (detected)
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1794 ] _boost_RELEASE_ABI_TAG = "-"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1795 ] _boost_DEBUG_ABI_TAG = "-gd"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1855 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = "C:/Program Files/boost/boost_1_71_0/lib;C:/Program Files/boost/boost_1_71_0/../lib;C:/Program Files/boost/boost_1_71_0/stage/lib;C:/Program Files/boost/boost_1_71_0/../lib32-msvc-14.0;C:/Program Files/boost/boost_1_71_0/lib32-msvc-14.0;C:/local/boost_1_71_0/lib32-msvc-14.0;C:/local/boost_1_71/lib32-msvc-14.0;C:/local/boost_1_70_0/lib32-msvc-14.0;C:/local/boost_1_70/lib32-msvc-14.0;C:/local/boost_1_69_0/lib32-msvc-14.0;C:/local/boost_1_69/lib32-msvc-14.0;C:/local/boost_1_68_0/lib32-msvc-14.0;C:/local/boost_1_68/lib32-msvc-14.0;C:/local/boost_1_67_0/lib32-msvc-14.0;C:/local/boost_1_67/lib32-msvc-14.0;C:/local/boost_1_66_0/lib32-msvc-14.0;C:/local/boost_1_66/lib32-msvc-14.0;C:/local/boost_1_65_1/lib32-msvc-14.0;C:/local/boost_1_65_0/lib32-msvc-14.0;C:/local/boost_1_65/lib32-msvc-14.0;C:/local/boost_1_64_0/lib32-msvc-14.0;C:/local/boost_1_64/lib32-msvc-14.0;C:/local/boost_1_63_0/lib32-msvc-14.0;C:/local/boost_1_63/lib32-msvc-14.0;C:/local/boost_1_62_0/lib32-msvc-14.0;C:/local/boost_1_62/lib32-msvc-14.0;C:/local/boost_1_61_0/lib32-msvc-14.0;C:/local/boost_1_61/lib32-msvc-14.0;C:/local/boost_1_60_0/lib32-msvc-14.0;C:/local/boost_1_60/lib32-msvc-14.0;C:/local/boost_1_59_0/lib32-msvc-14.0;C:/local/boost_1_59/lib32-msvc-14.0;C:/local/boost_1_58_0/lib32-msvc-14.0;C:/local/boost_1_58/lib32-msvc-14.0;C:/local/boost_1_57_0/lib32-msvc-14.0;C:/local/boost_1_57/lib32-msvc-14.0;C:/local/boost_1_56_0/lib32-msvc-14.0;C:/local/boost_1_56/lib32-msvc-14.0;C:/local/boost_1_55_0/lib32-msvc-14.0;C:/local/boost_1_55/lib32-msvc-14.0;C:/local/boost_1_54_0/lib32-msvc-14.0;C:/local/boost_1_54/lib32-msvc-14.0;C:/local/boost_1_53_0/lib32-msvc-14.0;C:/local/boost_1_53/lib32-msvc-14.0;C:/local/boost_1_52_0/lib32-msvc-14.0;C:/local/boost_1_52/lib32-msvc-14.0;C:/local/boost_1_51_0/lib32-msvc-14.0;C:/local/boost_1_51/lib32-msvc-14.0;C:/local/boost_1_50_0/lib32-msvc-14.0;C:/local/boost_1_50/lib32-msvc-14.0;C:/local/boost_1_49_0/lib32-msvc-14.0;C:/local/boost_1_49/lib32-msvc-14.0;C:/local/boost_1_48_0/lib32-msvc-14.0;C:/local/boost_1_48/lib32-msvc-14.0;C:/local/boost_1_47_0/lib32-msvc-14.0;C:/local/boost_1_47/lib32-msvc-14.0;C:/local/boost_1_46_1/lib32-msvc-14.0;C:/local/boost_1_46_0/lib32-msvc-14.0;C:/local/boost_1_46/lib32-msvc-14.0;C:/local/boost_1_45_0/lib32-msvc-14.0;C:/local/boost_1_45/lib32-msvc-14.0;C:/local/boost_1_44_0/lib32-msvc-14.0;C:/local/boost_1_44/lib32-msvc-14.0;C:/local/boost_1_43_0/lib32-msvc-14.0;C:/local/boost_1_43/lib32-msvc-14.0;C:/local/boost_1_42_0/lib32-msvc-14.0;C:/local/boost_1_42/lib32-msvc-14.0;C:/local/boost_1_41_0/lib32-msvc-14.0;C:/local/boost_1_41/lib32-msvc-14.0;C:/local/boost_1_40_0/lib32-msvc-14.0;C:/local/boost_1_40/lib32-msvc-14.0;C:/local/boost_1_39_0/lib32-msvc-14.0;C:/local/boost_1_39/lib32-msvc-14.0;C:/local/boost_1_38_0/lib32-msvc-14.0;C:/local/boost_1_38/lib32-msvc-14.0;C:/local/boost_1_37_0/lib32-msvc-14.0;C:/local/boost_1_37/lib32-msvc-14.0;C:/local/boost_1_36_1/lib32-msvc-14.0;C:/local/boost_1_36_0/lib32-msvc-14.0;C:/local/boost_1_36/lib32-msvc-14.0;C:/local/boost_1_35_1/lib32-msvc-14.0;C:/local/boost_1_35_0/lib32-msvc-14.0;C:/local/boost_1_35/lib32-msvc-14.0;C:/local/boost_1_34_1/lib32-msvc-14.0;C:/local/boost_1_34_0/lib32-msvc-14.0;C:/local/boost_1_34/lib32-msvc-14.0;C:/local/boost_1_33_1/lib32-msvc-14.0;C:/local/boost_1_33_0/lib32-msvc-14.0;C:/local/boost_1_33/lib32-msvc-14.0;C:/boost/lib32-msvc-14.0;PATHS;C:/boost/lib;C:/boost;/sw/local/lib"
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:1856 ] _boost_LIBRARY_SEARCH_DIRS_DEBUG = "C:/Program Files/boost/boost_1_71_0/lib;C:/Program Files/boost/boost_1_71_0/../lib;C:/Program Files/boost/boost_1_71_0/stage/lib;C:/Program Files/boost/boost_1_71_0/../lib32-msvc-14.0;C:/Program Files/boost/boost_1_71_0/lib32-msvc-14.0;C:/local/boost_1_71_0/lib32-msvc-14.0;C:/local/boost_1_71/lib32-msvc-14.0;C:/local/boost_1_70_0/lib32-msvc-14.0;C:/local/boost_1_70/lib32-msvc-14.0;C:/local/boost_1_69_0/lib32-msvc-14.0;C:/local/boost_1_69/lib32-msvc-14.0;C:/local/boost_1_68_0/lib32-msvc-14.0;C:/local/boost_1_68/lib32-msvc-14.0;C:/local/boost_1_67_0/lib32-msvc-14.0;C:/local/boost_1_67/lib32-msvc-14.0;C:/local/boost_1_66_0/lib32-msvc-14.0;C:/local/boost_1_66/lib32-msvc-14.0;C:/local/boost_1_65_1/lib32-msvc-14.0;C:/local/boost_1_65_0/lib32-msvc-14.0;C:/local/boost_1_65/lib32-msvc-14.0;C:/local/boost_1_64_0/lib32-msvc-14.0;C:/local/boost_1_64/lib32-msvc-14.0;C:/local/boost_1_63_0/lib32-msvc-14.0;C:/local/boost_1_63/lib32-msvc-14.0;C:/local/boost_1_62_0/lib32-msvc-14.0;C:/local/boost_1_62/lib32-msvc-14.0;C:/local/boost_1_61_0/lib32-msvc-14.0;C:/local/boost_1_61/lib32-msvc-14.0;C:/local/boost_1_60_0/lib32-msvc-14.0;C:/local/boost_1_60/lib32-msvc-14.0;C:/local/boost_1_59_0/lib32-msvc-14.0;C:/local/boost_1_59/lib32-msvc-14.0;C:/local/boost_1_58_0/lib32-msvc-14.0;C:/local/boost_1_58/lib32-msvc-14.0;C:/local/boost_1_57_0/lib32-msvc-14.0;C:/local/boost_1_57/lib32-msvc-14.0;C:/local/boost_1_56_0/lib32-msvc-14.0;C:/local/boost_1_56/lib32-msvc-14.0;C:/local/boost_1_55_0/lib32-msvc-14.0;C:/local/boost_1_55/lib32-msvc-14.0;C:/local/boost_1_54_0/lib32-msvc-14.0;C:/local/boost_1_54/lib32-msvc-14.0;C:/local/boost_1_53_0/lib32-msvc-14.0;C:/local/boost_1_53/lib32-msvc-14.0;C:/local/boost_1_52_0/lib32-msvc-14.0;C:/local/boost_1_52/lib32-msvc-14.0;C:/local/boost_1_51_0/lib32-msvc-14.0;C:/local/boost_1_51/lib32-msvc-14.0;C:/local/boost_1_50_0/lib32-msvc-14.0;C:/local/boost_1_50/lib32-msvc-14.0;C:/local/boost_1_49_0/lib32-msvc-14.0;C:/local/boost_1_49/lib32-msvc-14.0;C:/local/boost_1_48_0/lib32-msvc-14.0;C:/local/boost_1_48/lib32-msvc-14.0;C:/local/boost_1_47_0/lib32-msvc-14.0;C:/local/boost_1_47/lib32-msvc-14.0;C:/local/boost_1_46_1/lib32-msvc-14.0;C:/local/boost_1_46_0/lib32-msvc-14.0;C:/local/boost_1_46/lib32-msvc-14.0;C:/local/boost_1_45_0/lib32-msvc-14.0;C:/local/boost_1_45/lib32-msvc-14.0;C:/local/boost_1_44_0/lib32-msvc-14.0;C:/local/boost_1_44/lib32-msvc-14.0;C:/local/boost_1_43_0/lib32-msvc-14.0;C:/local/boost_1_43/lib32-msvc-14.0;C:/local/boost_1_42_0/lib32-msvc-14.0;C:/local/boost_1_42/lib32-msvc-14.0;C:/local/boost_1_41_0/lib32-msvc-14.0;C:/local/boost_1_41/lib32-msvc-14.0;C:/local/boost_1_40_0/lib32-msvc-14.0;C:/local/boost_1_40/lib32-msvc-14.0;C:/local/boost_1_39_0/lib32-msvc-14.0;C:/local/boost_1_39/lib32-msvc-14.0;C:/local/boost_1_38_0/lib32-msvc-14.0;C:/local/boost_1_38/lib32-msvc-14.0;C:/local/boost_1_37_0/lib32-msvc-14.0;C:/local/boost_1_37/lib32-msvc-14.0;C:/local/boost_1_36_1/lib32-msvc-14.0;C:/local/boost_1_36_0/lib32-msvc-14.0;C:/local/boost_1_36/lib32-msvc-14.0;C:/local/boost_1_35_1/lib32-msvc-14.0;C:/local/boost_1_35_0/lib32-msvc-14.0;C:/local/boost_1_35/lib32-msvc-14.0;C:/local/boost_1_34_1/lib32-msvc-14.0;C:/local/boost_1_34_0/lib32-msvc-14.0;C:/local/boost_1_34/lib32-msvc-14.0;C:/local/boost_1_33_1/lib32-msvc-14.0;C:/local/boost_1_33_0/lib32-msvc-14.0;C:/local/boost_1_33/lib32-msvc-14.0;C:/boost/lib32-msvc-14.0;PATHS;C:/boost/lib;C:/boost;/sw/local/lib"
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-vc140-mt-x32-1_71;boost_system-vc140-mt-x32;boost_system-vc140-mt;boost_system-mt-x32-1_71;boost_system-mt-x32;boost_system-mt;boost_system-mt;boost_system
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-vc140-mt-gd-x32-1_71;boost_system-vc140-mt-gd-x32;boost_system-vc140-mt-gd;boost_system-mt-gd-x32-1_71;boost_system-mt-gd-x32;boost_system-mt-gd;boost_system-mt;boost_system
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: boost_program_options-vc140-mt-x32-1_71;boost_program_options-vc140-mt-x32;boost_program_options-vc140-mt;boost_program_options-mt-x32-1_71;boost_program_options-mt-x32;boost_program_options-mt;boost_program_options-mt;boost_program_options
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: boost_program_options-vc140-mt-gd-x32-1_71;boost_program_options-vc140-mt-gd-x32;boost_program_options-vc140-mt-gd;boost_program_options-mt-gd-x32-1_71;boost_program_options-mt-gd-x32;boost_program_options-mt-gd;boost_program_options-mt;boost_program_options
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-vc140-mt-x32-1_71;boost_filesystem-vc140-mt-x32;boost_filesystem-vc140-mt;boost_filesystem-mt-x32-1_71;boost_filesystem-mt-x32;boost_filesystem-mt;boost_filesystem-mt;boost_filesystem
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-vc140-mt-gd-x32-1_71;boost_filesystem-vc140-mt-gd-x32;boost_filesystem-vc140-mt-gd;boost_filesystem-mt-gd-x32-1_71;boost_filesystem-mt-gd-x32;boost_filesystem-mt-gd;boost_filesystem-mt;boost_filesystem
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-vc140-mt-x32-1_71;boost_thread-vc140-mt-x32;boost_thread-vc140-mt;boost_thread-mt-x32-1_71;boost_thread-mt-x32;boost_thread-mt;boost_thread-mt;boost_thread
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-vc140-mt-gd-x32-1_71;boost_thread-vc140-mt-gd-x32;boost_thread-vc140-mt-gd;boost_thread-mt-gd-x32-1_71;boost_thread-mt-gd-x32;boost_thread-mt-gd;boost_thread-mt;boost_thread
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for CHRONO_LIBRARY_RELEASE: boost_chrono-vc140-mt-x32-1_71;boost_chrono-vc140-mt-x32;boost_chrono-vc140-mt;boost_chrono-mt-x32-1_71;boost_chrono-mt-x32;boost_chrono-mt;boost_chrono-mt;boost_chrono
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for CHRONO_LIBRARY_DEBUG: boost_chrono-vc140-mt-gd-x32-1_71;boost_chrono-vc140-mt-gd-x32;boost_chrono-vc140-mt-gd;boost_chrono-mt-gd-x32-1_71;boost_chrono-mt-gd-x32;boost_chrono-mt-gd;boost_chrono-mt;boost_chrono
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for DATE_TIME_LIBRARY_RELEASE: boost_date_time-vc140-mt-x32-1_71;boost_date_time-vc140-mt-x32;boost_date_time-vc140-mt;boost_date_time-mt-x32-1_71;boost_date_time-mt-x32;boost_date_time-mt;boost_date_time-mt;boost_date_time
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for DATE_TIME_LIBRARY_DEBUG: boost_date_time-vc140-mt-gd-x32-1_71;boost_date_time-vc140-mt-gd-x32;boost_date_time-vc140-mt-gd;boost_date_time-mt-gd-x32-1_71;boost_date_time-mt-gd-x32;boost_date_time-mt-gd;boost_date_time-mt;boost_date_time
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2040 ] Searching for ATOMIC_LIBRARY_RELEASE: boost_atomic-vc140-mt-x32-1_71;boost_atomic-vc140-mt-x32;boost_atomic-vc140-mt;boost_atomic-mt-x32-1_71;boost_atomic-mt-x32;boost_atomic-mt;boost_atomic-mt;boost_atomic
-- [ C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2095 ] Searching for ATOMIC_LIBRARY_DEBUG: boost_atomic-vc140-mt-gd-x32-1_71;boost_atomic-vc140-mt-gd-x32;boost_atomic-vc140-mt-gd;boost_atomic-mt-gd-x32-1_71;boost_atomic-mt-gd-x32;boost_atomic-mt-gd;boost_atomic-mt;boost_atomic
CMake Error at C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Boost (missing: system program_options filesystem thread)
  (found version "1.71.0")
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:2161 (find_package_handle_standard_args)
  CMakeLists.txt:108 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/Users/Dunkes/Desktop/C++_SDKs/FreeOpcUa/freeopcua-master/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Dunkes/Desktop/C++_SDKs/FreeOpcUa/freeopcua-master/build/CMakeFiles/CMakeError.log".
like image 791
Kuabel Avatar asked Sep 10 '19 11:09

Kuabel


3 Answers

You need to set BOOST_LIBRARYDIR in addition to BOOST_ROOT, e.g.:

cmake .. -DBOOST_ROOT="C:\Program Files\boost\boost_1_71_0" -DBOOST_LIBRARYDIR="C:\Program Files\boost\boost_1_71_0"

So that cmake can find the library binaries you built with:

bjam.exe install --prefix="C:\Program Files\boost\boost_1_71_0" --with-system --with-date_time --with-random link=static runtime-link=shared threading=multi

Note: the bjam command above should have built the boost library files in your
C:\Program Files\boost\boost_1_71_0\lib directory.

like image 117
kenba Avatar answered Nov 11 '22 19:11

kenba


Ok, so in the end the solution was to use the flag -DBoost_USE_STATIC_LIBS=ON to tell CMake to look for the STATIC libs. Many thanks to @Tsyvarev for his invaluable help.

like image 6
Kuabel Avatar answered Nov 11 '22 20:11

Kuabel


For those of you that built from source using the Visual Studio command prompt, note that the default value for Boost_COMPILER is "-vc", even though your libraries were built with names like "-vc141" (example for Visual Studio 2017).

Set Boost_COMPILER to the correct value before calling find_package(Boost) and see if that takes care of the problem.

Finally unearthed this after a few hours of frustration.

like image 1
ulatekh Avatar answered Nov 11 '22 20:11

ulatekh