Closed meiry closed 2 years ago
The short answer is that you need a separate boost installation on your platform. Use something like sudo apt-get install libboost-all-dev
or the usual instructions in the getting started guide.
Long answer: I just tried
mkdir build
cd build
cmake .. # or cmake .. -D Beast_BUILD_EXAMPLES=ON -D Beast_BUILD_TESTS=OFF to control what to build
cmake --build .
and both the configuration and building went fine. This is the result of the configuration step:
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1l")
-- Found Boost: /usr/local/lib/cmake/Boost-1.79.0/BoostConfig.cmake (found version "1.79.0") found components: coroutine filesystem system thread
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alandefreitas/Documents/Code/C++/boost/libs/beast/build
Notice how it found boost in Found Boost: /usr/local/lib/cmake/Boost-1.79.0/BoostConfig.cmake
. What happens here is that the CMakeLists.txt script takes a different path depending on whether the build is considered 1) a subproject of Boost called boost_beast
or 2) an independent library that depends on Boost called Beast
. We are recurring to option 2 here, that also includes the tests and examples.
This means we are configuring a Beast project that will look for OpenSSL and Boost on your platform instead of using the Boost library source files in the parent subdirectory. For instance, you can see the configuration step found boost in /usr/local/lib/cmake/Boost-1.79.0/BoostConfig.cmake
. The files in the parent directory are not important in this case.
@meiry
Does
https://github.com/boostorg/beast/issues/2402#issuecomment-1087963884
resolve the issue?
It (the short answer) did for me using Ubuntu 22 LTS Mate. But now there are other missing entries I have to find :)
Great :)
Perfect Solution here for me! I previously installed cmake with apt package and had this error and no idea why or how to fix it. this quick cmd line (short answer) did the trick TY! you save me quite some time!
Trying to compile in linux :
Looks like all boost configuration in placee but when i try to compile the example im getting :