Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have been trying to install boost for a while now, and I simply cannot get it to work. I will go over everything I have done, so probably it will be easier to understand why it is not working.

I started to clone Simple-WebSocket-Server
https://gitlab.com/eidheim/Simple-WebSocket-Server

I downloaded boost 1.67
https://dl.bintray.com/boostorg/release/1.67.0/source/

From the documentation
https://www.boost.org/doc/libs/1_67_0/more/getting_started/windows.html I build everything using
bootstrap
.2

Output:

The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
D:oost_1_67_0
The following directory should be added to linker library paths:
D:oost_1_67_0stagelib

When I try use cmake with the Simple-WebSocket-Server, I get the following output

CMake Warning at C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:577 (message):
Imported targets and dependency information not available for Boost version (all versions older than 1.33)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:959 (_Boost_COMPONENT_DEPENDENCIES)
C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES)
src/extlibs/Simple-WebSocket-Server/CMakeLists.txt:35 (find_package)

CMake Error at C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:2044 (message):
Unable to find the requested Boost libraries.

Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers.
Call Stack (most recent call first):
src/extlibs/Simple-WebSocket-Server/CMakeLists.txt:35 (find_package)

After much searching, I have tried the following options
CMake finds Boost but the imported targets not available for Boost version
I already have the latest CMake (3.12.1)

CMake with Boost library Windows 10 Library not found correctly
I tried rebuilding with these options
bootstrap.bat
b2 link=static runtime-link=static release stage
but still does not work

Following other answers, I added
set(BOOST_ROOT "D:/boost_1_67_0/")
and with, and without
set(BOOST_INCLUDEDIR "D:/boost_1_67_0/")
set(BOOST_LIBRARYDIR "D:/boost_1_67_0/libs")
I have tried many variations of BOOST_INCLUDEDIR and BOOST_LIBRARYDIR, including to the msvc specific dir lib64-msvc-14.1

to the CMakeList.txt (Not prefered, as I want the project to be untouched)

changes the error to

[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1883 ] Boost_FOUND = 1
Unable to find the requested Boost libraries.

Boost version: 1.67.0

Boost include path: D:/boost_1_67_0

Could not find the following Boost libraries:

     boost_system
     boost_thread
     boost_coroutine
     boost_context

Some (but not all) of the required Boost libraries were found. You may need to install these additional Boost libraries. Alternatively, set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost. Call Stack (most recent call first): src/extlibs/Simple-WebSocket-Server/CMakeLists.txt:36 (find_package)

I searched through the boost directory, and I have the 'missing' modules

I have even tried extract pre-built binaries, in case my build was faulty
https://sourceforge.net/projects/boost/files/boost-binaries/1.67.0/

The only thing that I have not tried yet is
CMake Boost Libraries Not Found Windows7 but should not be necessary?

I have noticed that I have one difference from what https://stackoverflow.com/a/33380087/9230431 says. I do not have a include directory inside the boost_1_67_0 root directory.

cmake cache values

BUILD_SHARED_LIBS:BOOL=OFF
BUILD_TESTING:BOOL=OFF
CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files (x86)/PROJ
GLFW_BUILD_DOCS:BOOL=OFF
GLFW_BUILD_EXAMPLES:BOOL=OFF
GLFW_BUILD_TESTS:BOOL=OFF
GLFW_DOCUMENT_INTERNALS:BOOL=OFF
GLFW_INSTALL:BOOL=OFF
GLFW_USE_HYBRID_HPG:BOOL=OFF
GLFW_VULKAN_STATIC:BOOL=OFF
LIB_EAY_DEBUG:FILEPATH=LIB_EAY_DEBUG-NOTFOUND
LIB_EAY_RELEASE:FILEPATH=LIB_EAY_RELEASE-NOTFOUND
LIB_SUFFIX:STRING=
OPENSSL_INCLUDE_DIR:PATH=D:/Strawberry/c/include
Qt5Core_DIR:PATH=C:/Qt/5.10.1/msvc2015/lib/cmake/Qt5Core
Qt5Gui_DIR:PATH=C:/Qt/5.10.1/msvc2015/lib/cmake/Qt5Gui
Qt5Network_DIR:PATH=C:/Qt/5.10.1/msvc2015/lib/cmake/Qt5Network
Qt5OpenGL_DIR:PATH=C:/Qt/5.10.1/msvc2015/lib/cmake/Qt5OpenGL
Qt5Widgets_DIR:PATH=C:/Qt/5.10.1/msvc2015/lib/cmake/Qt5Widgets
Qt5_DIR:PATH=C:/Qt/5.10.1/msvc2015/lib/cmake/Qt5
SSL_EAY_DEBUG:FILEPATH=SSL_EAY_DEBUG-NOTFOUND
SSL_EAY_RELEASE:FILEPATH=SSL_EAY_RELEASE-NOTFOUND
USE_MSVC_RUNTIME_LIBRARY_DLL:BOOL=ON
USE_STANDALONE_ASIO:BOOL=OFF


Full cmake output

Using Win32 for window creation
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1121 ] _boost_TEST_VERSIONS = 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
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1123 ] Boost_USE_MULTITHREADED = TRUE
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1125 ] Boost_USE_STATIC_LIBS =
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1127 ] Boost_USE_STATIC_RUNTIME =
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1129 ] Boost_ADDITIONAL_VERSIONS =
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1131 ] Boost_NO_SYSTEM_PATHS =
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1199 ] Declared as CMake or Environmental Variables:
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1201 ] BOOST_ROOT = D:/boost_1_67_0/
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1203 ] BOOST_INCLUDEDIR =
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1205 ] BOOST_LIBRARYDIR =
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1207 ] _boost_TEST_VERSIONS = 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
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1282 ] Include debugging info:
[ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1284 ] _boost_INCLUDE_SEARCH_DIRS = D:/boost_1_67_0//include;D:/boost_1_67_0/;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.12/Modules/FindBoost.cmake:1286 ] _boost_PATH_SUFFIXES = 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/b


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
162 views
Welcome To Ask or Share your Answers For Others

1 Answer

It is working now. I do not know exactly what it was, I simply reinstalled everything and built everything again. I think it may be related to the CMakeCache, as vre suggested, due to the cmake-gui and command prompt use different cache.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...