bjnord

bjnord

Hands-on Rust: Chapter 3: Can't get first hello to run

Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance running Amazon Linux 2 (their customized version of RHEL 7) and Rust 1.67.1

I’m using the exact code from FirstGameFlappyAscii/hello_bterm. If I compile and run that as-is, it blows up because I don’t have Wayland/X11/etc. on this box:

 Running `target/debug/flappy`
 thread 'main' panicked at 'Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: XOpenDisplayFailed', /home/bjn/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.27.5/src/platform_impl/linux/mod.rs:719:9

The GitHub - amethyst/bracket-lib: The Roguelike Toolkit (RLTK), implemented for Rust. section on “Feature flags” says to disable default features and enable a different back-end. So first I tried this:

 $ grep feature Cargo.toml
 bracket-lib = { version = "~0.8.1", default-features = false, features = ["crossterm"] }

…but that failed with this:

 Running `target/debug/flappy`
 thread 'main' panicked at 'index out of bounds: the len is 5628 but the index is 6566', /home/bjn/.cargo/registry/src/github.com-1ecc6299db9ec823/bracket-terminal-0.8.7/src/hal/crossterm_be/main_loop.rs:229:25

And then I tried this:

 $ grep feature Cargo.toml
 bracket-lib = { version = "~0.8.1", default-features = false, features = ["curses"] }

…but that failed with this:

 Compiling bracket-terminal v0.8.7
 error[E0609]: no field `fitscreen` on type `curses::InitHints`
 --> /home/bjn/.cargo/registry/src/github.com-1ecc6299db9ec823/bracket-terminal-0.8.7/src/initializer.rs:455:29
 |
 455 |         self.platform_hints.fitscreen = fitscreen;
 |                             ^^^^^^^^^ help: a field with a similar name exists: `fullscreen`

Help? Thanks! Brent

Popular Prag Prog topics Top

abtin
page 20: … protoc command… I had to additionally run the following go get commands in order to be able to compile protobuf code using go...
New
jimschubert
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
Razor54672
The answer to 3rd Problem of Chapter 5 (Making Choices) of “Practical Programming, Third Edition” seems incorrect in the given answer ke...
New
jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
oaklandgit
Hi, I completed chapter 6 but am getting the following error when running: thread 'main' panicked at 'Failed to load texture: IoError(O...
New
hazardco
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
Exadra37
Oh just spent so much time on this to discover now that RancherOS is in end of life but Rancher is refusing to mark the Github repo as su...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
PragmaticBookshelf
Author Spotlight: Sophie DeBenedetto @SophieDeBenedetto The days of the traditional request-response web application are long gone, b...
New

Latest in PragProg

View all threads ❯