You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<boost/asio/basic_stream_file.hpp>
#include<iostream>automain() -> int { auto b = boost::asio::basic_stream_file{}; }
g++ ./not_compiling.cpp -std=c++20 -lboost -o boost_testing
I receive following compilation error
$ g++ ./not_compiling.cpp -std=c++20 -lboost -o boost_testing
./not_compiling.cpp: In function ‘int main()’:
./not_compiling.cpp:5:38: error: ‘boost::asio’ has not been declared
5 | auto main() -> int { auto b = boost::asio::basic_stream_file{}; }
I believe that it is an issue with undefined macro BOOST_ASIO_HAS_FILE.
I've tried installing boost from arch repo, compiling from source on boost-1.81.0/1.80.0 branches with the same result.
It turns out you should also give BOOST_ASIO_DISABLE_EPOLL, otherwise you can get epoll re-registration: File exists [system:17] under certain circumstances when forking.
The backend is disabled by default, and must be enabled by defining both ASIO_HAS_IO_URING and ASIO_DISABLE_EPOLL.
Simply defining ASIO_HAS_IO_URING alone will enable the backend without using it for the existing I/O objects. This allows it to be used for I/O objects that require io_uring support, such as files.
I am trying to compile basic program:
g++ ./not_compiling.cpp -std=c++20 -lboost -o boost_testing
I receive following compilation error
I believe that it is an issue with undefined macro
BOOST_ASIO_HAS_FILE
.I've tried installing boost from arch repo, compiling from source on
boost-1.81.0/1.80.0
branches with the same result.Manually defining macro in
/usr/include/boost/asio/detail/config.hpp
did not help and generated another compilation errors.Now, why is that macro not defined? How can I fix it?
The text was updated successfully, but these errors were encountered: