Macro BOOST_ASIO_HAS_FILE not defined
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- operating-systems
Research direction
Start with the minimal program using boost/asio/basic_stream_file.hpp and inspect boost/asio/detail/config.hpp, comparing the reported Boost 1.80/1.81 builds and GCC 12.2.1 environment. Determine whether BOOST_ASIO_HAS_FILE should be enabled for this configuration and verify the result with the provided compilation command; done means the cause and a reproducible supported fix are established.
Written by the indexing model from the issue text.
Description
I am trying to compile basic program:
#include <boost/asio/basic_stream_file.hpp>
#include <iostream>
auto main() -> 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.
extra/boost 1.81.0-3 [installed]
Free peer-reviewed portable C++ source libraries (development headers)
g++ --version
g++ (GCC) 12.2.1 20230201
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?
- Dominant language
- C++
- Stars
- 1.6k
- Forks
- 485
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/asio
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
agent:WSL bug linux LOW ui
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Copter: PosHold brake-entry threshold became 16 deg instead of 0.16 deg after the radians conversionOpen
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ArduPilot/ardupilot#34617 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microsoft/microsoft-ui-xaml#12158 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 4 days
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 65/100
SynthstromAudible/DelugeFirmware#4969 ·
Maintainers usually reply within 1 day