the cdylib crate type cannot be used as rust extern crate, use "lib" instead.
if for some reason, the library must be built as cdylib, then the binary crate must import it via ffi as if it were a C library, and only use functions exported with the #[unsafe(no_mangle)] attribute.
you need to provide more details. what is this dll used for?
you can specify multiple crate types for the library crate, e.g.:
[lib]
name = "mylib"
crate-type = ["lib", "cdylib"]
note, this probably will make the code compile, but it may or may not work as you intended, it depends on the exact use case of the dll, so you need to provide more information.
the cdylib crate will have rust standard libraries all linked, and can be linked/loaded by programs in other languages, but it cannot be imported as regular rust extern crate, particularly, it is NOT linked as the dependency of the bin crate.
on the other hand,. the lib crate doesn't include the standard library, CANNOT be linked by other languages, but it is required to be imported by the bin crates.