  1878→    }
  1879→}
  1880→
  1881→// --- Main ---
  1882→
  1883→int main(int argc, char* argv[]) {
  1884→    if (argc < 2) {
  1885→        std::cerr << "Usage: build-index <output-dir> <input.osm.pbf> [options]" << std::endl;
  1886→        std::cerr << "       build-index <output-dir> --load-cache <path> [options]" << std::endl;
  1887→        std::cerr << std::endl;

    }
}

// --- Main ---

int main(int argc, char* argv[]) {
    if (argc < 2) {
        std::cerr << "Usage: build-index <output-dir> <input.osm.pbf> [options]" << std::endl;
        std::cerr << "       build-index <output-dir> --load-cache <path> [options]" << std::endl;
        std::cerr << std::endl;


  1873→
  1874→    write_futures.push_back(std::async(std::launch::async, [&] {
  1875→        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);
  1876→        f.write(data.string_pool.data().data(), data.string_pool.data().size());
  1877→        std::cerr << "strings.bin: " << data.string_pool.data().size() << " bytes" << std::endl;
  1878→    }
  1879→}
  1880→

    write_futures.push_back(std::async(std::launch::async, [&] {
        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);
        f.write(data.string_pool.data().data(), data.string_pool.data().size());
        std::cerr << "strings.bin: " << data.string_pool.data().size() << " bytes" << std::endl;
    }
}


Missing the closing `));` and the future waits.


Edit

    write_futures.push_back(std::async(std::launch::async, [&] {
        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);
        f.write(data.string_pool.data().data(), data.string_pool.data().size());
        std::cerr << "strings.bin: " << data.string_pool.data().size() << " bytes" << std::endl;
    }
}

    write_futures.push_back(std::async(std::launch::async, [&] {
        std::ofstream f(output_dir + "/strings.bin", std::ios::binary);
        f.write(data.string_pool.data().data(), data.string_pool.data().size());
        std::cerr << "strings.bin: " << data.string_pool.data().size() << " bytes" << std::endl;
    }));

    // Wait for all parallel writes
    admin_future.get();
    for (auto& f : write_futures) f.get();
}