Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requires at least Boost 1.72, compiler errors w/ USE_BOOST_FILESYSTEM #87

Open
CodeFinder2 opened this issue Jul 4, 2022 · 1 comment

Comments

@CodeFinder2
Copy link

Hi,

due to the use of directory_options, this requires at least Boost 1.72, not 1.54 as stated in the README.

 1.72.0
 New: Added directory_options enum, which reflects the same named enum from C++20. The enum is supported in directory_iterator and recursive_directory_iterator to customize iteration behavior. In particular, the iterators now support skipping directories that can't be opened due to insufficient permissions. The symlink_option enum is now deprecated and should be replaced with directory_options.

See also https://www.boost.org/doc/libs/1_72_0/libs/filesystem/doc/release_history.html

May I create a PR to add compatibility for older Boost versions?

There are also issues when using USE_BOOST_FILESYSTEM=ON on Ubuntu 18.04 so that I would address them in the PR as well.

  • include/inotify-cpp/FileSystemAdapter.h:35:36: error: invalid return type ‘boost::none_t’ of constexpr function ‘constexpr boost::none_t inotifypp::nullopt()’ inline constexpr boost::none_t nullopt() { return boost::none; };
  • src/Inotify.cpp:108:27: error: ‘fs::directory_options’ has not been declared path, fs::directory_options::follow_directory_symlink, ec);
  • include/inotify-cpp/FileSystemAdapter.h:5:10: fatal error: filesystem: No such file or directory #include <filesystem> (when included, e.g., from main(), library integrated via CPM). This is because the in main.cpp, the definition is not available because it is not forwarded (added) in CMake to the inotify-cpp target. Alternatively, creating a configure file would work as well (making the definitions available to includes as well).
@CodeFinder2 CodeFinder2 changed the title Requires at least Boost 1.72 Requires at least Boost 1.72, compiler errors w/ USE_BOOST_FILESYSTEM Jul 4, 2022
@CodeFinder2
Copy link
Author

Changes in the following files/lines would be necessary:

  • include/inotify-cpp/FileSystemAdapter.h:{5,39}
  • src/Inotify.cpp:108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant