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

johnp
Hi Brian, Looks like the api for tinydb has changed a little. Noticed while working on chapter 7 that the .purge() call to the db throws...
New
GilWright
Working through the steps (checking that the Info,plist matches exactly), run the demo game and what appears is grey but does not fill th...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
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
gilesdotcodes
In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions: In Gemfile, change gem 'rails' t...
New
leba0495
Hello! Thanks for the great book. I was attempting the Trie (chap 17) exercises and for number 4 the solution provided for the autocorre...
New
jskubick
I’m running Android Studio “Arctic Fox” 2020.3.1 Patch 2, and I’m embarrassed to admit that I only made it to page 8 before running into ...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
mert
AWDWR 7, page 152, page 153: Hello everyone, I’m a little bit lost on the hotwire part. I didn’t fully understand it. On page 152 @rub...
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1042 20430 390
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
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
rustkas
Intensively researching Erlang books and additional resources on it, I have found that the topic of using Regular Expressions is either c...
New
PragmaticBookshelf
Use WebRTC to build web applications that stream media and data in real time directly from one user to another, all in the browser. ...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
sir.laksmana_wenk
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc. However, I don’t...
New
mindriot
Ok, well here are some thoughts and opinions on some of the ergonomic keyboards I have, I guess like mini review of each that I use enoug...
New

Sub Categories: