staticlib
kouzhudong opened this issue · 0 comments
kouzhudong commented
When I use this warehouse to create a static library, the compilation is successful. However, when I connect this static library to a driver (written in c/cpp/rust), a connection error occurs.
1>Ntstrsafe.lib(stubs.obj) : error LNK2005: _fltused 已经在 lib_drv_rs.lib(lib_drv_rs-7edd6e2e9cf34bd7.wdk_alloc-2f7aa50fc157ee7f.wdk_alloc.c21c9f9d55100c01-cgu.0.rcgu.o.rcgu.o) 中定义
1>lib_drv_rs.lib(lib_drv_rs-7edd6e2e9cf34bd7.wdk_alloc-2f7aa50fc157ee7f.wdk_alloc.c21c9f9d55100c01-cgu.0.rcgu.o.rcgu.o) : error LNK2019: 无法解析的外部符号 WdfFunctions_01033,函数 _ZN4core3ops8function6FnOnce9call_once17hae8e3e88db06564dE 中引用了该符号
D:\git\gitlab\code\test\rust\src\wdm_rs>cargo build
Compiling wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs)
Compiling wdk-sys v0.2.0
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
error: language item required, but not found: `eh_personality`
|
= note: this can occur when a binary crate with `#![no_std]` is compiled for a target where `eh_personality` is defined in the standard library
= help: you may be able to compile for a target that doesn't need `eh_personality`, specify a target with `--target` or in `.cargo/config`
The following warnings were emitted during compilation:
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
warning: wdm_lib_rs@0.1.0: cargo:rustc-cdylib-link-arg was specified in the build script of wdm_lib_rs v0.1.0 (D:\git\gitlab\code\test\rust\src\wdm_lib_rs), but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
error: could not compile `wdm_lib_rs` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
D:\git\gitlab\code\test\rust\src\wdm_rs>