锈vulkano中未解决的导入`image`

时间:2020-03-31 18:02:40

标签: rust vulkan

我正在尝试在Windows 10上重现this vulkano example。代码是in the website repository。我的Cargo.toml包含以下内容:

[package]
name = "guide-mandelbrot"
version = "0.1.0"
authors = ["an1052"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
vulkano = "0.13"

构建失败,并给出以下答案:

E:\documents\code\rust\guide-mandelbrot> cargo build
  Updating crates.io index
  Downloaded vulkano v0.13.0
  Downloaded crossbeam v0.7.3
  Downloaded fnv v1.0.6
  Downloaded smallvec v0.6.13
  Downloaded lazy_static v1.4.0
  Downloaded shared_library v0.1.9
  Downloaded crossbeam-deque v0.7.3
  Downloaded cfg-if v0.1.10
  Downloaded crossbeam-channel v0.4.2
  Downloaded half v1.5.0
  Downloaded crossbeam-utils v0.7.2
  Downloaded crossbeam-queue v0.2.1
  Downloaded crossbeam-epoch v0.8.2
  Downloaded maybe-uninit v2.0.0
  Downloaded autocfg v1.0.0
  Downloaded vk-sys v0.4.0
  Downloaded scopeguard v1.1.0
  Downloaded memoffset v0.5.4
  Downloaded libc v0.2.68
   Compiling autocfg v1.0.0
   Compiling lazy_static v1.4.0
   Compiling maybe-uninit v2.0.0
   Compiling cfg-if v0.1.10
   Compiling libc v0.2.68
   Compiling scopeguard v1.1.0
   Compiling vulkano v0.13.0
   Compiling vk-sys v0.4.0
   Compiling fnv v1.0.6
   Compiling half v1.5.0
   Compiling smallvec v0.6.13
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.4
   Compiling crossbeam-epoch v0.8.2
   Compiling shared_library v0.1.9
   Compiling crossbeam-queue v0.2.1
   Compiling crossbeam-channel v0.4.2
   Compiling crossbeam-deque v0.7.3
   Compiling crossbeam v0.7.3
   Compiling guide-mandelbrot v0.1.0 (E:\documents\code\rust\guide-mandelbrot)
error[E0432]: unresolved import `image`
  --> src\main.rs:15:5
   |
15 | use image::ImageBuffer;
   |     ^^^^^ help: a similar path exists: `vulkano::image`

error[E0432]: unresolved import `image`
  --> src\main.rs:16:5
   |
16 | use image::Rgba;
   |     ^^^^^ help: a similar path exists: `vulkano::image`

error[E0433]: failed to resolve: use of undeclared type or module `vulkano_shaders`
  --> src\main.rs:55:9
   |
55 |         vulkano_shaders::shader!{
   |         ^^^^^^^^^^^^^^^ use of undeclared type or module `vulkano_shaders`

error[E0433]: failed to resolve: could not find `Shader` in `cs`
  --> src\main.rs:81:22
   |
81 |     let shader = cs::Shader::load(device.clone()).expect("failed to create shader module");
   |                      ^^^^^^ could not find `Shader` in `cs`

我希望这张图片:

1 个答案:

答案 0 :(得分:0)

Cargo.toml错过了板条箱shaderc,图像和vulkano着色器。

[package]
name = "guide-mandelbrot"
version = "0.1.0"
authors = ["an1052"]
edition = "2018"

[dependencies]
shaderc = "0.6"
vulkano = "0.13"
image = "0.23.2"
vulkano-shaders = "0.18.0"