Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Cannot build for dynamic loading #44

@silvioprog

Description

@silvioprog

Problem:

When we try to build the library with dynamic loading support, it emits the following error at build time:

C:\dev\git\deepspeech-rs> cargo build --features dynamic
   Compiling deepspeech v0.9.0 (C:\dev\git\deepspeech-rs)
warning: type `size_t` should have an upper camel case name
 --> src\dynamic_bindings.rs:1:10
  |
1 | pub type size_t = :: std :: os :: raw :: c_ulong ;
  |          ^^^^^^ help: convert the identifier to upper camel case: `SizeT`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

warning: type `DeepSpeech_Error_Codes` should have an upper camel case name
  --> src\dynamic_bindings.rs:73:11
   |
73 |  pub type DeepSpeech_Error_Codes = :: std :: os :: raw :: c_uint ;
   |           ^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `DeepSpeechErrorCodes`

error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
  --> src\dynamic_bindings.rs:79:40
   |
79 | let inner = std :: sync :: Arc :: new (libloading :: Library :: new (& path) ?) ;
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
   |
   = note: consult the function's documentation for information on how to avoid undefined behavior

error: aborting due to previous error; 2 warnings emitted

For more information about this error, try `rustc --explain E0133`.
error: could not compile `deepspeech`

To learn more, run the command again with --verbose.

Environment:

rustc --version --verbose
rustc 1.53.0 (53cb7b09b 2021-06-17)
binary: rustc
commit-hash: 53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b
commit-date: 2021-06-17
host: x86_64-pc-windows-msvc
release: 1.53.0
LLVM version: 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions