Is there a way to link to a library that is not in the current package path.
This link suggests placing everything under the local directory. Our packages are installed in some kind of repository elsewhere. I just want to point libpath to it in windows.
authors = ["Me"] links = "CDbax" [target.x86_64-pc-windows-gnu.CDbax] rustc-link-lib = ["CDbax"] rustc-link-search = ["Z:/Somepath//CPP/CDbax/x64/Debug/"] root = "Z:/Somepath//CPP/CDbax/x64/Debug/"
But trying to build the -v load gives me
package `hello v0.1.0 (file:
From the build script manual, it will be shown that this should work. But I see that he did not add a path. However, moving lib to the local path bin\x68_64-pc-windows-gnu\ works.
Update Thanks to the answer below, I thought I was updating this to give final results of what works on my machine, so that others would find it useful.
In Cargo.toml add
links = "CDbax" build = "build.rs"
Although the build.rs file is missing, it seems that it (?) Otherwise complains about
package `xxx v0.1.0` specifies that it links to `CDbax` but does not have a custom build script
Vaelden then responds to creating a configuration file in .cargo
If this is a subdirectory, you do not need to put the links = tag in the parent box, although it is a dll; even with "cargo mileage". I assume that adds the dll path to the runtime
source share