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

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
simonpeter
When I try the command to create a pair of migration files I get an error. user=> (create-migration "guestbook") Execution error (Ill...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
adamwoolhether
When trying to generate the protobuf .go file, I receive this error: Unknown flag: --go_opt libprotoc 3.12.3 MacOS 11.3.1 Googling ...
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
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
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
gorkaio
root_layout: {PentoWeb.LayoutView, :root}, This results in the following following error: no “root” html template defined for PentoWeb...
New

Other popular topics Top

AstonJ
If it’s a mechanical keyboard, which switches do you have? Would you recommend it? Why? What will your next keyboard be? Pics always w...
New
dasdom
No chair. I have a standing desk. This post was split into a dedicated thread from our thread about chairs :slight_smile:
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
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
PragmaticBookshelf
Programming Ruby is the most complete book on Ruby, covering both the language itself and the standard library as well as commonly used t...
New
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
RobertRichards
Hair Salon Games for Girls Fun Girls Hair Saloon game is mainly developed for kids. This game allows users to select virtual avatars to ...
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: