vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.55k stars 437 forks source link

unresolved imports in example #1571

Closed AliBasicCoder closed 2 years ago

AliBasicCoder commented 3 years ago

i copy pasted triangle.rs in examples to my main.rs and added this to Cargo.toml

[dependencies]
vulkano = "0.22"
vulkano-shaders = "0.22"
vulkano-win = "0.22"
winit = "0.24"

and this what i got

❯ cargo run --verbose
       Fresh cfg-if v1.0.0
       Fresh unicode-xid v0.2.2
       Fresh pkg-config v0.3.19
       Fresh lazy_static v1.4.0
       Fresh xml-rs v0.8.3
       Fresh smallvec v1.6.1
       Fresh cfg-if v0.1.10
       Fresh version_check v0.9.3
       Fresh once_cell v1.7.2
       Fresh downcast-rs v1.2.0
       Fresh cc v1.0.67
       Fresh scoped-tls v1.0.0
       Fresh ttf-parser v0.6.2
       Fresh autocfg v1.0.1
       Fresh scopeguard v1.1.0
       Fresh same-file v1.0.6
       Fresh ab_glyph_rasterizer v0.1.4
       Fresh xdg v2.2.0
       Fresh slab v0.4.3
       Fresh lazycell v1.3.0
       Fresh half v1.7.1
       Fresh vk-sys v0.6.0
       Fresh percent-encoding v2.1.0
       Fresh fnv v1.0.7
       Fresh libloading v0.7.0
       Fresh instant v0.1.9
       Fresh libloading v0.6.7
       Fresh owned_ttf_parser v0.6.0
       Fresh lock_api v0.4.4
       Fresh walkdir v2.3.2
       Fresh cmake v0.1.45
       Fresh libc v0.2.94
       Fresh bitflags v1.2.1
       Fresh dlib v0.5.0
       Fresh dlib v0.4.2
       Fresh log v0.4.14
       Fresh memchr v2.4.0
       Fresh rusttype v0.9.2
       Fresh maybe-uninit v2.0.0
       Fresh proc-macro2 v1.0.26
       Fresh wayland-sys v0.28.5
       Fresh andrew v0.3.1
       Fresh crossbeam-utils v0.8.4
       Fresh quote v1.0.9
       Fresh crossbeam-queue v0.3.1
       Fresh wayland-scanner v0.28.5
       Fresh syn v1.0.72
       Fresh nix v0.20.0
       Fresh parking_lot_core v0.8.3
       Fresh nix v0.18.0
       Fresh iovec v0.1.4
       Fresh net2 v0.2.37
       Fresh memmap2 v0.1.0
       Fresh shared_library v0.1.9
       Fresh x11-dl v2.18.5
       Fresh raw-window-handle v0.3.3
       Fresh wayland-commons v0.28.5
       Fresh parking_lot v0.11.1
       Fresh calloop v0.6.5
       Fresh mio v0.6.23
       Fresh wayland-client v0.28.5
       Fresh vulkano v0.22.0
       Fresh mio-extras v2.0.6
       Fresh wayland-protocols v0.28.5
       Fresh nom v6.1.2
       Fresh shaderc-sys v0.7.2
       Fresh xcursor v0.3.3
       Fresh shaderc v0.7.2
       Fresh wayland-cursor v0.28.5
       Fresh vulkano-shaders v0.22.0
       Fresh smithay-client-toolkit v0.12.3
       Fresh winit v0.24.0
       Fresh vulkano-win v0.22.0
   Compiling vl v0.1.0 (/home/alianmad/web/vl)
     Running `rustc --crate-name vl --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=2e8d786b6a08483a -C extra-filename=-2e8d786b6a08483a --out-dir /home/alianmad/web/vl/target/debug/deps -C incremental=/home/alianmad/web/vl/target/debug/incremental -L dependency=/home/alianmad/web/vl/target/debug/deps --extern vulkano=/home/alianmad/web/vl/target/debug/deps/libvulkano-517c63897a9da40a.rlib --extern vulkano_shaders=/home/alianmad/web/vl/target/debug/deps/libvulkano_shaders-0384bbd01cf78579.so --extern vulkano_win=/home/alianmad/web/vl/target/debug/deps/libvulkano_win-c42bf84e7fd45209.rlib --extern winit=/home/alianmad/web/vl/target/debug/deps/libwinit-18d3902e95d41afc.rlib`
error[E0432]: unresolved import `vulkano::command_buffer::CommandBufferUsage`
  --> src/main.rs:21:31
   |
21 |     AutoCommandBufferBuilder, CommandBufferUsage, DynamicState, SubpassContents,
   |                               ^^^^^^^^^^^^^^^^^^
   |                               |
   |                               no `CommandBufferUsage` in `command_buffer`
   |                               help: a similar name exists in the module: `CommandBuffer`

error[E0432]: unresolved import `vulkano::render_pass`
  --> src/main.rs:29:14
   |
29 | use vulkano::render_pass::{Framebuffer, FramebufferAbstract, RenderPass, Subpass};
   |              ^^^^^^^^^^^ could not find `render_pass` in `vulkano`

error: aborting due to 2 previous errors

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

Caused by:
  process didn't exit successfully: `rustc --crate-name vl --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=2e8d786b6a08483a -C extra-filename=-2e8d786b6a08483a --out-dir /home/alianmad/web/vl/target/debug/deps -C incremental=/home/alianmad/web/vl/target/debug/incremental -L dependency=/home/alianmad/web/vl/target/debug/deps --extern vulkano=/home/alianmad/web/vl/target/debug/deps/libvulkano-517c63897a9da40a.rlib --extern vulkano_shaders=/home/alianmad/web/vl/target/debug/deps/libvulkano_shaders-0384bbd01cf78579.so --extern vulkano_win=/home/alianmad/web/vl/target/debug/deps/libvulkano_win-c42bf84e7fd45209.rlib --extern winit=/home/alianmad/web/vl/target/debug/deps/libwinit-18d3902e95d41afc.rlib` (exit code: 1)
Rua commented 3 years ago

CommandBufferUsage has only been added recently, and isn't in the 0.22 release. If you want to use it, you'll need the git master version instead:

[dependencies]
vulkano = {git = "https://github.com/vulkano-rs/vulkano"}
vulkano-shaders = {git = "https://github.com/vulkano-rs/vulkano"}
vulkano-win = {git = "https://github.com/vulkano-rs/vulkano"}

Note that this is unstable, so be prepared for that.

AliBasicCoder commented 3 years ago

CommandBufferUsage has only been added recently, and isn't in the 0.22 release. If you want to use it, you'll need the git master version instead:

[dependencies]
vulkano = {git = "https://github.com/vulkano-rs/vulkano"}
vulkano-shaders = {git = "https://github.com/vulkano-rs/vulkano"}
vulkano-win = {git = "https://github.com/vulkano-rs/vulkano"}

Note that this is unstable, so be prepared for that.

what about volkano::render_pass?

Rua commented 3 years ago

Same, also not in 0.22.

Eliah-Lakhin commented 3 years ago

@AliBasicCoder We have a lot of upcoming changes in master. I'm going to make another release soon, and put some migration notes.