Volohnix

Volohnix

Hands-on Rust: Can't make executable work

Hello, first post in this platform.. so if I posting in the wrong place, forgive me.

I’m finishing my journey with the book but I cannot make my executable to work:

thread 'main' panicked at /Users/miname/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/bracket-terminal-0.8.7/src/hal/gl_common/font.rs:45:18:
Failed to load texture: IoError(Os { code: 2, kind: NotFound, message: "No such file or directory" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I’ve already checked the folder arrangement and looks ok:

mygame folder is also following this:

.
├── Cargo.lock
├── Cargo.toml
├── readme.md
├── resources
│   ├── dungeonfont.png
│   ├── template.ron
│   └── terminal8x8.png
└── src
    ├── camera.rs
    ├── components.rs
    ├── main.rs
    ├── map_builder
    │   ├── automata.rs
    │   ├── drunkard.rs
    │   ├── empty.rs
    │   ├── mod.rs
    │   ├── prefab.rs
    │   ├── rooms.rs
    │   └── themes.rs
    ├── map.rs
    ├── spawner
    │   ├── mod.rs
    │   └── template.rs
    ├── systems
    │   ├── chasing.rs
    │   ├── combat.rs
    │   ├── end_turn.rs
    │   ├── entity_render.rs
    │   ├── fov.rs
    │   ├── hud.rs
    │   ├── map_render.rs
    │   ├── mod.rs
    │   ├── movement.rs
    │   ├── player_input.rs
    │   ├── random_move.rs
    │   ├── tooltips.rs
    │   ├── use_item.rs
    │   └── use_items.rs
    └── turn_state.rs
fn main() -> BError {
    let context = BTermBuilder::new()
        .with_title("Dungeon Crawler")
        .with_fps_cap(30.0)
        .with_dimensions(DISPLAY_WIDTH, DISPLAY_HEIGHT)
        .with_tile_dimensions(32, 32)
        .with_resource_path("resources/")
        .with_font("dungeonfont.png", 32, 32)
        .with_font("terminal8x8.png", 8, 8)
        .with_simple_console(
            DISPLAY_WIDTH,
            DISPLAY_HEIGHT,
            "dungeonfont.png",
        )
        .with_simple_console_no_bg(
            DISPLAY_WIDTH,
            DISPLAY_HEIGHT,
            "dungeonfont.png",
        )
        .with_simple_console_no_bg(
            SCREEN_WIDTH * 2,
            SCREEN_HEIGHT * 2,
            "terminal8x8.png",
        )
        .build()?;

    main_loop(context, State::new())
}


When I run the game with cargo run it works perfectly. The issue is only with the build --release

Where Next?

Popular Pragmatic Bookshelf topics Top

belgoros
Following the steps described in Chapter 6 of the book, I’m stuck with running the migration as described on page 84: bundle exec sequel...
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
New
rmurray10127
Title: Intuitive Python: docker run… denied error (page 2) Attempted to run the docker command in both CLI and Powershell PS C:\Users\r...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
AndyDavis3416
@noelrappin Running the webpack dev server, I receive the following warning: ERROR in tsconfig.json TS18003: No inputs were found in c...
New
jgchristopher
“The ProductLive.Index template calls a helper function, live_component/3, that in turn calls on the modal component. ” Excerpt From: Br...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
dtonhofer
@parrt In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New
mcpierce
@mfazio23 I’ve applied the changes from Chapter 5 of the book and everything builds correctly and runs. But, when I try to start a game,...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
483 10427 254
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
I have seen the keycaps I want - they are due for a group-buy this week but won’t be delivered until October next year!!! :rofl: The Ser...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
New
Fl4m3Ph03n1x
Background Lately I am in a quest to find a good quality TTS ai generation tool to run locally in order to create audio for some videos I...
New

Sub Categories: