You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 5, 2022. It is now read-only.
Hello. After following the steps in your "Quickstart" section of the README.md, I tried compiling a crate using deepspeech-rs v0.6.1 on Windows 10, and I'm having the following error :
LINK : fatal error LNK1181: cannot open input file 'deepspeech.lib'
It looks like the compiler can't find a file but I don't know how to get it.
I'm really sorry if it's not the right place to talk about this but I can't find help anywhere else.
I didn't get any file called deepspeech.lib with the tar.gz file you mentioned on your README and the native_client version for Windows, and the native_client is added to my path.
@LeSplooch don't worry I got the idea just now and was already afraid you dismissed deepspeech completely. With rust-lang/rust#58713 we might make the usage of .lib files obsolete.
Also if my suggestion doesnt work, try changing it to deepspeech.so.if.
I was about to do it but I've never worked with folder crates yet, so I'd need a little help in order to import that into my code. I just cargo add everything most of the time or link the git in Cargo.toml.
I'm really sorry for the delayed answer. So deepspeech-rs is cloned and linked in Cargo.toml and ./deepspeech-rs/sys/build.rs has been modified to this :
That issue is because the linker can't find those files. But they exist, you just have to tell the directory the downloaded precompiled library lies inside. Have you added it to the PATH environment variable?
// It's bugged on windows >:(#[cfg(target_os = "windows")]fnmain(){println!(r"cargo:rustc-link-search=C:\deepspeech");println!("cargo:rustc-link-lib=libdeepspeech.so.if");}#[cfg(not(target_os = "windows"))]fnmain(){println!("cargo:rustc-link-lib=deepspeech");}
I also have put the folder I downloaded where I marked above. (I had it deeper in my file tree, but my username has a space in it and rustc was having a hard time with it.) I also added that folder to PATH.
Probably what I'll do is set it up with an environment variable, and include in the install instructions to set it to wherever you put the files. Then build.rs just queries the variable.
For the record, if you want to tell the linker on Windows where you have libraries installed, you need to modify LIB, not PATH. LIB is used to find libraries (foo.lib) at link time, PATH is used to find binaries (foo.dll/foo.exe) at run time.
@retep998 If I understand you correctly, I should create a value containing a comma seperated array with the path to the folder where my deepspeech.lib file is, and assign it to a new variable called LIB, is that it?
I have no LIB variable at the moment.
I tried it and now I have another error, but I think it's a good sign, it looks like the libraries have been found but it can't handle them for some reason (I'm not familiar with linker errors).
Here is the output :
= note: libdeepspeech-596af0fd2763f984.rlib(deepspeech-596af0fd2763f984.deepspeech.6i45m1o7-cgu.2.rcgu.o) : error LNK2019: unresolved external symbol DS_EnableExternalScorer referenced in function _ZN10deepspeech5Model22enable_external_scorer17h9fc6471303cc31e3E
libdeepspeech-596af0fd2763f984.rlib(deepspeech-596af0fd2763f984.deepspeech.6i45m1o7-cgu.2.rcgu.o) : error LNK2019: unresolved external symbol DS_DisableExternalScorer referenced in function _ZN10deepspeech5Model23disable_external_scorer17h3721a9ad438e6571E
libdeepspeech-596af0fd2763f984.rlib(deepspeech-596af0fd2763f984.deepspeech.6i45m1o7-cgu.2.rcgu.o) : error LNK2019: unresolved external symbol DS_GetModelBeamWidth referenced in function
_ZN10deepspeech5Model20get_model_beam_width17ha127ef1639900027E
libdeepspeech-596af0fd2763f984.rlib(deepspeech-596af0fd2763f984.deepspeech.6i45m1o7-cgu.2.rcgu.o) : error LNK2019: unresolved external symbol DS_SetModelBeamWidth referenced in function
_ZN10deepspeech5Model20set_model_beam_width17h3cfba3f016bf445fE
libdeepspeech-596af0fd2763f984.rlib(deepspeech-596af0fd2763f984.deepspeech.6i45m1o7-cgu.2.rcgu.o) : error LNK2019: unresolved external symbol DS_SetScorerAlphaBeta referenced in function _ZN10deepspeech5Model21set_scorer_alpha_beta17hf22408dd472bc89eE
libdeepspeech-596af0fd2763f984.rlib(deepspeech-596af0fd2763f984.deepspeech.6i45m1o7-cgu.2.rcgu.o) : error LNK2019: unresolved external symbol DS_Version referenced in function _ZN10deepspeech18deepspeech_version17ha05bd2d6a0180a9cE
F:\Rust Test\cpal_test\target\release\deps\cpal_test.exe : fatal error LNK1120: 6 unresolved externals
error: aborting due to previous error; 6 warnings emitted
I followed @gamma-delta's instructions but now I'm getting error: process didn't exit successfully: `target\release\examples\client.exe G:\models G:\voice.ogg` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)
Summary of what I did:
Created vendored directory in my project where I cloned https://github.com/RustAudio/deepspeech-rs/ at commit f94b98d429bdac30b9b9aaa048946537b6ebd575 (it was the last successfully building one)
Downloaded native_client for windows and put it in vendored/deepspeech-win
At this point it compiles fine now that it can find the libdeepspeech.so.if file. However when I try to run any of the examples or tests or the binary in general I see that STATUS_DLL_NOT_FOUND error.
What's confusing me the most is I thought this would be statically linking the library so why is it looking for a DLL in the first place?
Activity
est31 commentedon Feb 7, 2020
Have you added the directory with deepspeech.lib to your path?
LeSplooch commentedon Feb 7, 2020
I didn't get any file called deepspeech.lib with the tar.gz file you mentioned on your README and the native_client version for Windows, and the native_client is added to my path.
est31 commentedon Feb 7, 2020
Hmm I see, that's a valid question. There is a .lib file in the windows native client but it's called differently.
LeSplooch commentedon Feb 7, 2020
Indeed, there is a file called
libdeepspeech.so.if.lib
.est31 commentedon Apr 27, 2020
@LeSplooch if you clone this repo, and change the "deepspeech" in sys/build.rs to deepspeech.so, does it work then?
LeSplooch commentedon Apr 28, 2020
Oh sorry I just saw your post, I'll try this asap and let you know about the result.
est31 commentedon Apr 28, 2020
@LeSplooch don't worry I got the idea just now and was already afraid you dismissed deepspeech completely. With rust-lang/rust#58713 we might make the usage of .lib files obsolete.
Also if my suggestion doesnt work, try changing it to
deepspeech.so.if
.LeSplooch commentedon Apr 30, 2020
I was about to do it but I've never worked with folder crates yet, so I'd need a little help in order to import that into my code. I just
cargo add
everything most of the time or link the git in Cargo.toml.est31 commentedon May 1, 2020
@LeSplooch the docs for path dependencies are here: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-path-dependencies
You could clone deepspeech-rs and then point to the local clone via path instead of the crates.io version.
LeSplooch commentedon May 14, 2020
I'm really sorry for the delayed answer. So
deepspeech-rs
is cloned and linked inCargo.toml
and./deepspeech-rs/sys/build.rs
has been modified to this :But now I have a problem : apparently,
Model.enable_decoder_with_lm()
doesn't exist anymore, and I don't know what to replace it with.est31 commentedon May 14, 2020
It's not needed any more, see 9876695
LeSplooch commentedon May 14, 2020
I still have a link.exe fatal error message with both
deepspeech.so
anddeepspeech.so.if
.= note: LINK : fatal error LNK1181: cannot open input file 'deepspeech.so.lib'
= note: LINK : fatal error LNK1181: cannot open input file 'deepspeech.so.if.lib'
est31 commentedon May 14, 2020
That issue is because the linker can't find those files. But they exist, you just have to tell the directory the downloaded precompiled library lies inside. Have you added it to the
PATH
environment variable?LeSplooch commentedon May 15, 2020
The absolute path to
native_client
is among myPath
env vars.gamma-delta commentedon May 24, 2020
I'm also having this problem.
gamma-delta commentedon May 24, 2020
I guess I should add something a little more helpful...
I've changed
build.rs
locally to exactly the name of the file I downloaded:It still doesn't work, even though the folder is in my path.
where libdeepspeech.so.if.lib
succeeds (I'm using Cygwin).EDIT:
libdeepspeech.so
like you suggested also doesn't work.gamma-delta commentedon May 24, 2020
I got it!
My local copy of
build.rs
now looks like this:I also have put the folder I downloaded where I marked above. (I had it deeper in my file tree, but my username has a space in it and
rustc
was having a hard time with it.) I also added that folder toPATH
.Yay! Hope this helps @LeSplooch!
est31 commentedon May 24, 2020
@gamma-delta Awesome! Can you put this into a PR?
gamma-delta commentedon May 24, 2020
Maybe! I'm not the best at Github.
Probably what I'll do is set it up with an environment variable, and include in the install instructions to set it to wherever you put the files. Then
build.rs
just queries the variable.retep998 commentedon Jul 7, 2020
For the record, if you want to tell the linker on Windows where you have libraries installed, you need to modify
LIB
, notPATH
.LIB
is used to find libraries (foo.lib
) at link time,PATH
is used to find binaries (foo.dll
/foo.exe
) at run time.LeSplooch commentedon Jul 21, 2020
@retep998 If I understand you correctly, I should create a value containing a comma seperated array with the path to the folder where my
deepspeech.lib
file is, and assign it to a new variable calledLIB
, is that it?I have no
LIB
variable at the moment.LeSplooch commentedon Jul 21, 2020
I tried it and now I have another error, but I think it's a good sign, it looks like the libraries have been found but it can't handle them for some reason (I'm not familiar with linker errors).
Here is the output :
teovoinea commentedon Sep 6, 2020
I followed @gamma-delta's instructions but now I'm getting
error: process didn't exit successfully: `target\release\examples\client.exe G:\models G:\voice.ogg` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)
Summary of what I did:
vendored
directory in my project where I clonedhttps://github.com/RustAudio/deepspeech-rs/
at commitf94b98d429bdac30b9b9aaa048946537b6ebd575
(it was the last successfully building one)vendored/deepspeech-win
vendored/deepspeech-rs/sys/build.rs
according to this comment cannot open input file 'deepspeech.lib' / Windows 10 #25 (comment) replacing the directory withvendored/deepspeech-win
At this point it compiles fine now that it can find the
libdeepspeech.so.if
file. However when I try to run any of the examples or tests or the binary in general I see thatSTATUS_DLL_NOT_FOUND
error.What's confusing me the most is I thought this would be statically linking the library so why is it looking for a DLL in the first place?
Saviio commentedon Dec 5, 2021
@teovoinea
I have met this issue like you, have you resolve this problem?
Saviio commentedon Dec 5, 2021
oh, i have added set rustc-link-search= C:\deepspeech before I run cargo run --release --example client
example/client can be run successfully.
but In my scenario, I got another error: