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

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
conradwt
First, the code resources: Page 237: rumbl_umbrella/apps/rumbl/mix.exs Note: That this file is missing. Page 238: rumbl_umbrella/app...
New
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
jonmac
The allprojects block listed on page 245 produces the following error when syncing gradle: “org.gradle.api.GradleScriptException: A prob...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
Keton
When running the program in chapter 8, “Implementing Combat”, the printout Health before attack was never printed so I assumed something ...
New
davetron5000
Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
483 11975 256
New
PragmaticBookshelf
Tailwind CSS is an exciting new CSS framework that allows you to design your site by composing simple utility classes to create complex e...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
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
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New
PragmaticBookshelf
Explore the power of Ash Framework by modeling and building the domain for a real-world web application. Rebecca Le @sevenseacat and ...
New
PragmaticBookshelf
Fight complexity and reclaim the original spirit of agility by learning to simplify how you develop software. The result: a more humane a...
New

Sub Categories: