Bindgen cargo:rustc-link-search does not search correctly

    let dir = env::var("CARGO_MANIFEST_DIR").unwrap();
    //println!("{}", dir);
    println!(
        "cargo:rustc-link-search={}",
        Path::new(&dir).join("lib").to_str().unwrap()
    );
    println!("cargo:rustc-link-lib=fmod");

Running cargo test
I get: process didn't exit successfully: `Z:\fmod-sys\target\debug\deps\fmod_sys-da70d1db139b5151.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

The paths are correct, the linker path is being ran, I have no idea why this doesn't work: despite telling it to look in the lib folder. When I drag all the dlls in the debug\deps\fmod-sys folder it works though.

It linked sucessfully, but to actually run it, windows needs to find the dll at runtime. Windows doesn't have support for rpaths, so you will either need to place the dll in the same dirbas the executable or install it into C:\Windows\System32.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.