boostorg / boostorg/asio

Macro BOOST_ASIO_HAS_FILE not defined

Open
#409 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.6k
Forks
485
PR merge metrics
No merged PRs in 30d

Description

I am trying to compile basic program:

```cpp

#include
#include

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.