Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gfx_backend_gl and metal: can't find create #3746

Open
str0yd opened this issue May 6, 2021 · 3 comments
Open

gfx_backend_gl and metal: can't find create #3746

str0yd opened this issue May 6, 2021 · 3 comments

Comments

@str0yd
Copy link

str0yd commented May 6, 2021

Short info header:

  • GFX version: hal-0.8 branch
  • OS: Windows
  • GPU: name: "Radeon RX Vega", vendor: 4098, device: 26751, device_type: DiscreteGpu

I just cloed the hal-0.8 branch but i can't compile the project with the gl or metal backend.
Vulkan and dx12 work without problems.

cargo run --bin quad --features=metal --verbose

...

 Compiling hal-examples v0.1.0 (C:\Users\woppe\Documents\Rust\gfx\examples)
     Running `rustc --crate-name quad --edition=2018 examples\quad/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C 
debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"gfx-backend-metal\"" --cfg "feature=\"metal\"" -C metadata=f4746ad78445d47e --out-dir C:\Users\woppe\Documents\Rust\gfx\target\debug\deps -C incremental=C:\Users\woppe\Documents\Rust\gfx\target\debug\incremental -L dependency=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps --extern env_logger=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libenv_logger-8093f0d2061d370e.rlib --extern auxil=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_auxil-e01f05fbe3fa2e9e.rlib --extern gfx_backend_empty=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_backend_empty-9a2421f8c1e1762b.rlib --extern hal=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_hal-dbb4ed462378e6d2.rlib --extern glsl_to_spirv=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libglsl_to_spirv-594eb747adb46adf.rlib --extern image=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libimage-39ea8928c1c74296.rlib --extern log=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\liblog-63efc7b73bb752d4.rlib --extern winit=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libwinit-bd2eed038f4d40eb.rlib -L native=C:\Users\woppe\Documents\Rust\gfx\target\debug\build\spirv_cross-20e5095eddfd2691\out`
error[E0463]: can't find crate for `gfx_backend_metal`
  --> examples\quad/main.rs:16:1
   |
16 | extern crate gfx_backend_metal as back;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `hal-examples`

Caused by:
  process didn't exit successfully: `rustc --crate-name quad --edition=2018 examples\quad/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link 
-C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"gfx-backend-metal\"" --cfg "feature=\"metal\"" -C metadata=f4746ad78445d47e --out-dir C:\Users\woppe\Documents\Rust\gfx\target\debug\deps -C incremental=C:\Users\woppe\Documents\Rust\gfx\target\debug\incremental -L dependency=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps --extern env_logger=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libenv_logger-8093f0d2061d370e.rlib --extern auxil=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_auxil-e01f05fbe3fa2e9e.rlib --extern gfx_backend_empty=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_backend_empty-9a2421f8c1e1762b.rlib --extern hal=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_hal-dbb4ed462378e6d2.rlib --extern glsl_to_spirv=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libglsl_to_spirv-594eb747adb46adf.rlib --extern image=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libimage-39ea8928c1c74296.rlib --extern log=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\liblog-63efc7b73bb752d4.rlib --extern winit=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libwinit-bd2eed038f4d40eb.rlib -L native=C:\Users\woppe\Documents\Rust\gfx\target\debug\build\spirv_cross-20e5095eddfd2691\out` (exit code: 1)
cargo run --bin quad --features=gl --verbose 

...

Compiling hal-examples v0.1.0 (C:\Users\woppe\Documents\Rust\gfx\examples)
     Running `rustc --crate-name quad --edition=2018 examples\quad/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C 
debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"gfx-backend-gl\"" --cfg "feature=\"gl\"" -C metadata=f4746ad78445d47e --out-dir C:\Users\woppe\Documents\Rust\gfx\target\debug\deps -C incremental=C:\Users\woppe\Documents\Rust\gfx\target\debug\incremental -L dependency=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps --extern env_logger=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libenv_logger-8093f0d2061d370e.rlib --extern auxil=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_auxil-7e99373e38da53e7.rlib --extern gfx_backend_empty=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_backend_empty-4045f1e1c2eb80ab.rlib --extern hal=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_hal-43eeb2f3535dda60.rlib --extern glsl_to_spirv=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libglsl_to_spirv-594eb747adb46adf.rlib --extern image=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libimage-39ea8928c1c74296.rlib --extern log=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\liblog-63efc7b73bb752d4.rlib --extern winit=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libwinit-bd2eed038f4d40eb.rlib -L native=C:\Users\woppe\Documents\Rust\gfx\target\debug\build\spirv_cross-6c122e85c970c048\out`
error[E0463]: can't find crate for `gfx_backend_gl`
  --> examples\quad/main.rs:14:1
   |
14 | extern crate gfx_backend_gl as back;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `hal-examples`

Caused by:
  process didn't exit successfully: `rustc --crate-name quad --edition=2018 examples\quad/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link 
-C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"default\"" --cfg "feature=\"gfx-backend-gl\"" --cfg "feature=\"gl\"" -C metadata=f4746ad78445d47e --out-dir C:\Users\woppe\Documents\Rust\gfx\target\debug\deps -C incremental=C:\Users\woppe\Documents\Rust\gfx\target\debug\incremental -L dependency=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps --extern env_logger=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libenv_logger-8093f0d2061d370e.rlib --extern auxil=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_auxil-7e99373e38da53e7.rlib --extern gfx_backend_empty=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_backend_empty-4045f1e1c2eb80ab.rlib --extern hal=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libgfx_hal-43eeb2f3535dda60.rlib --extern glsl_to_spirv=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libglsl_to_spirv-594eb747adb46adf.rlib --extern image=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libimage-39ea8928c1c74296.rlib --extern log=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\liblog-63efc7b73bb752d4.rlib --extern winit=C:\Users\woppe\Documents\Rust\gfx\target\debug\deps\libwinit-bd2eed038f4d40eb.rlib -L native=C:\Users\woppe\Documents\Rust\gfx\target\debug\build\spirv_cross-6c122e85c970c048\out` (exit code: 1)
@str0yd str0yd changed the title Cant gfx_backend_gl and metal: can't find create May 6, 2021
@kvark
Copy link
Member

kvark commented May 6, 2021

Each backend is available only on selected platforms. Metal backend - only when building for macOS/iOS. OpenGL backend - only when building for Linux.
Closing this, but please feel free to continue discussion (or jump to #gfx:matrix.org)

@kvark kvark closed this as completed May 6, 2021
@str0yd
Copy link
Author

str0yd commented May 7, 2021

Thanks for the information, could not find it anywhere else. Maybe you should state this somewhere in the examples section.

@kvark
Copy link
Member

kvark commented May 7, 2021

I agree it would be good to add some better error message if you attempted to build examples with a feature that's not available on your platform. Or at least in https://github.com/gfx-rs/gfx/tree/master/examples.

@kvark kvark reopened this May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants