boostorg / beast

HTTP and WebSocket built on Boost.Asio in C++11
http://www.boost.org/libs/beast
Boost Software License 1.0
4.37k stars 639 forks source link

how to fix "fatal error: boost/beast/core/detail/config.hpp: No such file or directory" #967

Closed Binsoma closed 6 years ago

Binsoma commented 6 years ago

Hi there, I have boost c++ libraries in /usr/local/boost_1_66_0/stage/include/boost/

I am trying to compile a c++ example and i'm getting fatal errors. how to make a compiler see everything exact location? thanks

vinniefalco commented 6 years ago

Can you please provide more information? What build system are you using?

Binsoma commented 6 years ago

I'm using debian with boost 1.66.0. I have a Boost Library Binary at /usr/local/boost_1_66_0/stage/include/boost/

Binsoma commented 6 years ago

I was compiling Websocket client example from " http://www.boost.org/doc/libs/master/libs/beast/doc/html/beast/quick_start.html

vinniefalco commented 6 years ago

So you're using bjam? make? CMake?

Binsoma commented 6 years ago

I used ./bootstrap.sh and ./b2 install from "http://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html "

cmazakas commented 6 years ago

It sounds like you need to add the Boost include directory to your compiler's list of include paths.

Make sure you compile with something like -I/usr/local/boost_1_66_0/stage/include

Binsoma commented 6 years ago

now I'm getting this error "/usr/local/boost_1_66_0/stage/include/boost/beast/core/impl/buffers_adapter.ipp: In member function ‘boost::beast::buffers_adapter::const_buffers_type::const_iterator& boost::beast::buffers_adapter::const_buffers_type::const_iterator::operator--()’: /usr/local/boost_1_66_0/stage/include/boost/beast/core/impl/buffersadapter.ipp:121:11: error: ‘it’ was not declared in this scope --it_;"

Binsoma commented 6 years ago

In function boost::asio::detail::posix_thread::start_thread(boost::asio::detail::posix_thread::func_base*)': websocketclient.cpp:(.text._ZN5boost4asio6detail12posix_thread12start_threadEPNS2_9func_baseE[_ZN5boost4asio6detail12posix_thread12start_threadEPNS2_9func_baseE]+0x29): undefined reference topthread_create' collect2: error: ld returned 1 exit status

cmazakas commented 6 years ago

This makes good sense.

Trying using -pthread as well. You may also have to link to some specific Boost libraries as well.

Make sure you re-read the documentation in Boost. They give some examples of how to link to some Boost libraries. You'll need to do this as well.

vinniefalco commented 6 years ago

Has this issue been resolved?

Pernath commented 5 years ago

Apparently it has not. Why is it closed? It is not old or unrelatable at all.

vinniefalco commented 5 years ago

There was nothing actionable here for me (i.e. no changes in beast were required), so the issue could safely be closed. Note that closed issues can still receive replies, which would be appropriate here, except that the OP hasn't responded in over a year which is fairly strong evidence that either they figured it out, or gave up.

nikitasius commented 5 years ago

Thats how i fond you:

HEAD is now at 3a1f602... Fix CircleCI error on wrong indentation (#662)
[ 52%] Performing patch step for 'soci'
[ 53%] Performing update step for 'soci'
[ 54%] Performing configure step for 'soci'
-- soci configure command succeeded.  See also /home/nikitas/crypto/xrp/rippled/.nih_c/unix_makefiles/GNU_6.3.0/Release/src/soci-stamp/soci-configure-*.log
[ 55%] Performing build step for 'soci'
-- soci build command succeeded.  See also /home/nikitas/crypto/xrp/rippled/.nih_c/unix_makefiles/GNU_6.3.0/Release/src/soci-stamp/soci-build-*.log
[ 55%] No install step for 'soci'
[ 56%] No test step for 'soci'
[ 57%] Completed 'soci'
[ 57%] Built target soci
Scanning dependencies of target rippled
[ 58%] Building CXX object CMakeFiles/rippled.dir/src/ripple/unity/app_consensus.cpp.o
In file included from /home/nikitas/crypto/xrp/rippled/src/ripple/beast/container/aged_unordered_map.h:23:0,
                 from /home/nikitas/crypto/xrp/rippled/src/ripple/ledger/CachedSLEs.h:25,
                 from /home/nikitas/crypto/xrp/rippled/src/ripple/ledger/CachedView.h:23,
                 from /home/nikitas/crypto/xrp/rippled/src/ripple/app/ledger/Ledger.h:25,
                 from /home/nikitas/crypto/xrp/rippled/src/ripple/app/consensus/RCLCxLedger.h:23,
                 from /home/nikitas/crypto/xrp/rippled/src/ripple/app/consensus/RCLConsensus.h:23,
                 from /home/nikitas/crypto/xrp/rippled/src/ripple/app/consensus/RCLConsensus.cpp:20,
                 from /home/nikitas/crypto/xrp/rippled/src/ripple/unity/app_consensus.cpp:20:
/home/nikitas/crypto/xrp/rippled/src/ripple/beast/container/detail/aged_unordered_container.h:27:63: fatal error: boost/beast/core/detail/empty_base_optimization.hpp: No such file or directory
 #include <boost/beast/core/detail/empty_base_optimization.hpp>
                                                               ^
compilation terminated.
CMakeFiles/rippled.dir/build.make:62: recipe for target 'CMakeFiles/rippled.dir/src/ripple/unity/app_consensus.cpp.o' failed
make[2]: *** [CMakeFiles/rippled.dir/src/ripple/unity/app_consensus.cpp.o] Error 1
CMakeFiles/Makefile2:132: recipe for target 'CMakeFiles/rippled.dir/all' failed
make[1]: *** [CMakeFiles/rippled.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

line 27:

where:

find . -name *empty_base_optimization*
./rippled/.nih_c/unix_makefiles/GNU_6.3.0/Release/nudb_src-src/extras/beast/include/beast/core/detail/empty_base_optimization.hpp
./rippled/.nih_c/unix_makefiles/GNU_6.3.0/Release/nudb_src-src/extras/beast/test/core/empty_base_optimization.cpp

Guess it's rippled's problem.

upd: they say what rippled should use 1.67 version exact :confused: https://github.com/ripple/rippled/issues/2991#issuecomment-506734416