Let’s say I have a package
mypackage that depends on a package
kiss3d depends on some third package
glfw. Those last two are real packages, but I don’t think that matters right now. Now: let’s say I want to make an object
glfw::Obj, and pass it to
kiss3d::some_function. Now, in my
Cargo.toml I need to depend on both:
[dependencies] kiss3d = "*" glfw = "*"
dependency depends on a different version of
base, this won’t work; instead I get a weird error like so:
src/main.rs:213:17: 213:74 error: mismatched types: expected `glfw::WindowEvent`, found `glfw::WindowEvent` (expected enum `glfw::WindowEvent`, found a different enum `glfw::WindowEvent`) [E0308]
glfw::WindowEvent is the
glfw::Obj mentioned above.
This happens because
kiss3d has this in its
[dependencies.glfw] git = "https://github.com/bjz/glfw-rs" default-features = false
So one version is compiled for
kiss3d without default features from the GitHub source, and one is compiled from crates.io with default features for my library.
So now I need to copy and paste this dependency into my
Or is there some way to say
extern crate kiss3d::glfw, meaning “use the same
glfw crate that
kiss3d is using”, so that I’m not copying and pasting dependencies?
kiss3d be exporting all possible objects from glfw that I might want? Or just exporting the module