bh1xuw / rust-rocks

Make RocksDB really rocks! The Rust style API.
Apache License 2.0
46 stars 7 forks source link

Working with RocksDB on Win10 #6

Closed RustSmoker closed 4 years ago

RustSmoker commented 6 years ago

Hi everyone. I started to examine Rocksdb but recieving an error compiling hw project, having rocks="0.1" in [dependencies] of Cargo.toml. I asked about this at the official forum, and was told that Rocksdb might not work on Windows10 . Is there a way to use Rocksdb on Windows10, or im doing something else wrong?

bh1xuw commented 4 years ago

Install vcpkg, then install RocksDB with vcpkg.

Modification to build.rs:

// main()
    println!("cargo:rustc-link-lib=static=zlib");
    build.include("C:/Users/???/vcpkg/packages/rocksdb_x64-windows/include");
    println!("cargo:rustc-link-search=native=C:/Users/???/vcpkg/packages/rocksdb_x64-windows/lib");
    println!("cargo:rustc-link-search=native=C:/Users/???/vcpkg/packages/snappy_x64-windows/lib");
    println!("cargo:rustc-link-search=native=C:/Users/???/vcpkg/packages/zlib_x64-windows/lib");
    println!("cargo:rustc-link-search=native=C:/Program Files (x86)/Windows Kits/10/Lib/10.0.18362.0/um/x64");

    println!("cargo:rustc-link-lib=static=shlwapi");
    println!("cargo:rustc-link-lib=static=rpcrt4");
bh1xuw commented 4 years ago

Then you might need copy zlib1.dll to your project dir.

bh1xuw commented 4 years ago

Fixed by #17. Thanks.