Skip to content

Fix Windows compatibility using C++17 std::filesystem - #1

Open
chuong-data61 wants to merge 1 commit into
hugohadfield:masterfrom
chuong-data61:win-compat
Open

Fix Windows compatibility using C++17 std::filesystem#1
chuong-data61 wants to merge 1 commit into
hugohadfield:masterfrom
chuong-data61:win-compat

Conversation

@chuong-data61

Copy link
Copy Markdown

This pull request introduces Windows compilation compatibility by updating the POSIX-specific directory scanning logic to standard C++17 <filesystem>.

Rationale & Changes:

  1. Removed <dirent.h> dependency: Windows/MSVC does not natively support <dirent.h>, which previously caused compilation to fail with cannot open include file: 'dirent.h'. This has been replaced with standard C++17 <filesystem> in src/lens_distortion_correction_2p_iterative_optimization.cpp.
  2. Updated read_directory: Rewrote the directory-listing function to use C++17 std::filesystem::directory_iterator.
  3. Updated C++ standard: Added set(CMAKE_CXX_STANDARD 17) and set(CMAKE_CXX_STANDARD_REQUIRED ON) to CMakeLists.txt so that all compilers compile with C++17 mode enabled.
  4. Updated Documentation: Added Windows build instructions and Git submodule cloning prerequisites to README.md.

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

Successfully merging this pull request may close these issues.

1 participant