Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources not found. #1

Closed
N4tus opened this issue Aug 19, 2021 · 3 comments
Closed

Resources not found. #1

N4tus opened this issue Aug 19, 2021 · 3 comments

Comments

@N4tus
Copy link

N4tus commented Aug 19, 2021

When compiling with RUSTFLAGS='-C target-cpu=native' cargo build --release the resulting binary panics with:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: 
ResourceNotFound("/cards.png", [
("~/games/freecell/target/release/resources", IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })),
("~/.local/share/freecell", IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })), 
("~/.config/freecell", IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" })), 
("./resources", IOError(Os { code: 2, kind: NotFound, message: "No such file or directory" }))
])',
src/game.rs:41:61
@IGI-111
Copy link
Owner

IGI-111 commented Aug 19, 2021

Tried a clean build but I can't reproduce.
What OS and architecture are you running?

@N4tus
Copy link
Author

N4tus commented Aug 19, 2021

the thing is, that the binary has to be executed next to the "resources" folder. When using a cargo build the binary is not located there. Is is possible to include the resources in the binary? Copying both together works but it would just be nice to have one binary that includes all.

@IGI-111
Copy link
Owner

IGI-111 commented Aug 19, 2021

Unfortunately, that's how ggez works, there is a trick to add the Cargo manifest path to build and run (see here) but I haven't found a way to embed the ressources in the binary so far.

Closing since this is working as intended.

@IGI-111 IGI-111 closed this as completed Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants