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

thread 'main' panicked at 'Could not create window: "Couldn\'t find any pixel format that matches the criterias #193

Open
martinak1 opened this issue Apr 10, 2018 · 6 comments

Comments

@martinak1
Copy link

martinak1 commented Apr 10, 2018

Attempted to follow the sudoku example up to chapter 5 where you are supposed to compile and the game board is displayed. Instead I get the following error with this backtrace:

thread 'main' panicked at 'Could not create window: "Couldn\'t find any pixel format that matches the criterias."', libcore/result.rs:945:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:23
  10: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:809
  11: sudoku::main
             at src/main.rs:43
  12: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:479
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:458
             at libstd/panic.rs:358
             at libstd/rt.rs:58
  16: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  17: main
  18: __libc_start_main
  19: _start

I went through the code to make sure I did not make an error, and just to be extra sure, I cloned the repository and tried to build the example from the source provided. This is the error and backtrace provided from that:

thread 'main' panicked at 'Could not create window: "Couldn\'t find any pixel format that matches the criterias."', libcore/result.rs:945:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:380
   3: std::panicking::default_hook
             at libstd/panicking.rs:396
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:576
   5: std::panicking::begin_panic
             at libstd/panicking.rs:537
   6: std::panicking::begin_panic_fmt
             at libstd/panicking.rs:521
   7: rust_begin_unwind
             at libstd/panicking.rs:497
   8: core::panicking::panic_fmt
             at libcore/panicking.rs:71
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:23
  10: <core::result::Result<T, E>>::expect
             at /checkout/src/libcore/result.rs:809
  11: sudoku::main
             at src/main.rs:29
  12: std::rt::lang_start::{{closure}}
             at /checkout/src/libstd/rt.rs:74
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:479
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:102
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:458
             at libstd/panic.rs:358
             at libstd/rt.rs:58
  16: std::rt::lang_start
             at /checkout/src/libstd/rt.rs:74
  17: main
  18: __libc_start_main
  19: _start

Bellow is my system info:

$ uname -r:  
     4.15.13-300.fc27.x86_64
$ cargo --version: 
     cargo 0.26.0 (41480f5cc 2018-02-26)
$ rustup show: 
   Default host: x86_64-unknown-linux-gnu
   stable-x86_64-unknown-linux-gnu (default)
   rustc 1.25.0 (84203cac6 2018-03-25)

Please let me know if I need to provide any more information.

@martinak1
Copy link
Author

I was able to solve the issue by disabling srgb, but it might be a good idea to mention this issue in the tutorial as it seems to be fairly common.

@maffei2443
Copy link

@martinak1 how do I do that?
I'm having the same problem

@martinak1
Copy link
Author

@maffei2443 unfortunately I no longer have the code I was working on. I believe it was something simple like bellow, but I do not remember where it was specified.

.srgb(false)

I found the answer in one of the previous issues, so that may be your best place to look.

@atoav
Copy link

atoav commented Aug 18, 2018

When I set .srgb(false) I get the Error:

OpenGL Warning: glXChooseVisual: ignoring attribute 0x22
OpenGL Warning: vboxCall failed with VBox status code VERR_BUFFER_OVERFLOW

thread 'main' panicked at 'gl function was not loaded', /home/atoav/radiu/target/debug/build/gl-ec15099b00e923a0/out/bindings.rs:20624:13

I used Linux Mint 19 running as a virtualbox guest and disabling 3D-acceleration in the Virtualbox Settings fixed this for me.

@drazde
Copy link

drazde commented Oct 6, 2018

I have the same problem on Windows 10...

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 2.41s
     Running `target\debug\spinning-square.exe`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Couldn\'t find any pixel format that matches the criterias."', libcore\result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: process didn't exit successfully: `target\debug\spinning-square.exe` (exit code: 101)

@categulario
Copy link

I have the same problem on Windows 10...

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 2.41s
     Running `target\debug\spinning-square.exe`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Couldn\'t find any pixel format that matches the criterias."', libcore\result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: process didn't exit successfully: `target\debug\spinning-square.exe` (exit code: 101)

were you able to solve it?

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

5 participants